xxxrrrdddd 3 vuotta sitten
vanhempi
commit
85f55f8174

+ 1 - 1
application/api/controller/AdminOrder.php

@@ -326,7 +326,7 @@ class AdminOrder extends SenderApi
     public function send_detail(){
         $data=input();
         $this->validate($data,[
-            'id'=>['require']
+            'id|订单ID'=>['require']
         ]);
         $user=$this->auth->getUser();
         $order=$user->orders()->findOrFail($data['id']);

+ 4 - 4
application/api/controller/CommentController.php

@@ -27,8 +27,8 @@ class CommentController extends Api
     public function index(){
         $data=input();
         $this->validate($data,[
-            'commentable_type'=>['require'],
-            'commentable_id'=>['require'],
+            'commentable_type|评论类型'=>['require'],
+            'commentable_id|评论类型ID'=>['require'],
         ]);
         $comments=Comment::order('id','desc')
             ->with(['user'])
@@ -48,8 +48,8 @@ class CommentController extends Api
         $data=input();
         $this->validate($data,[
             'body|评论'=>['require','max:200'],
-            'commentable_type'=>['require','in:'.implode(',',array_keys(Comment::$alias))],
-            'commentable_id'=>['require'],
+            'commentable_type|评论类型'=>['require','in:'.implode(',',array_keys(Comment::$alias))],
+            'commentable_id|评论类型ID'=>['require'],
         ]);
         Db::startTrans();
         model($data['commentable_type'])->findOrFail($data['commentable_id']);

+ 1 - 1
application/api/controller/Common.php

@@ -120,7 +120,7 @@ class Common extends Api
     public function feedback(){
         $data=input();
         $this->validate($data,[
-            'body'=>['require','max:250'],
+            'body|内容'=>['require','max:250'],
         ]);
         $this->auth->getUser()->feedback()->save([
             'body'=>$data['body'],

+ 12 - 12
application/api/controller/InfoController.php

@@ -36,9 +36,9 @@ class InfoController extends Api
         $data=input();
         if(empty($data['keyword'])) {
             $this->validate($data, [
-                'type' => ['require', 'in:1,2,3,4'],
-                'longitude' => ['requireIf:type,1'],
-                'latitude' => ['requireIf:type,1'],
+                'type|类型' => ['require', 'in:1,2,3,4'],
+                'longitude|经度' => ['requireIf:type,1'],
+                'latitude|纬度' => ['requireIf:type,1'],
             ]);
             $q = Info::type($data)
                 ->order('id', 'desc')
@@ -72,7 +72,7 @@ class InfoController extends Api
     public function detail(){
         $data=input();
         $this->validate($data,[
-            'id'=>['require'],
+            'id|ID'=>['require'],
         ]);
         $list=Info::show()->findOrFail($data['id'])->append(['user','theme']);
         $this->success('',$list);
@@ -89,12 +89,12 @@ class InfoController extends Api
     public function post(){
         $data=input();
         $this->validate($data,[
-            'content'=>['require','max:500'],
-            'theme'=>['array'],
-            'images'=>['array'],
-            'longitude'=>['require'],
-            'latitude'=>['require'],
-            'position'=>['require'],
+            'content|内容'=>['require','max:500'],
+            'theme|话题'=>['array'],
+            'images|图片'=>['array'],
+            'longitude|经度'=>['require'],
+            'latitude|纬度'=>['require'],
+            'position|位置'=>['require'],
         ]);
         $data['city']=tm()->getLocation($data['longitude'],$data['latitude'])['city'];
         Db::startTrans();
@@ -129,8 +129,8 @@ class InfoController extends Api
     public function follow(){
         $data=input();
         $this->validate($data,[
-            'user_id'=>['require'],
-            'type'   =>['require','in:1,2'],
+            'user_id|用户'=>['require'],
+            'type|类型'   =>['require','in:1,2'],
         ]);
         $user=$this->auth->getUser();
         if($data['type']==1){

+ 3 - 3
application/api/controller/Sender.php

@@ -29,9 +29,9 @@ class Sender extends SenderApi
     public function verification(){
         $data=input();
         $this->validate($data,[
-            'id_z'=>['require','url'],
-            'id_f'=>['require','url'],
-            'license'=>['require','url'],
+            'id_z|身份证正面'=>['require','url'],
+            'id_f|身份证反面'=>['require','url'],
+            'license|执照'=>['require','url'],
         ]);
         $user=$this->auth->getUser();
         $vf=$user->verification;

+ 8 - 8
application/api/controller/SenderOrderController.php

@@ -231,8 +231,8 @@ class SenderOrderController extends SenderApi
         $data=input();
         $this->validate($data,[
             'id'=>['require'],
-            'media'=>['array','max:3'],
-            'status'=>['require','in:'.implode(',',array_keys(UserOrderLog::$status))],
+            'media|图片或视频'=>['array','max:3'],
+            'status|状态'=>['require','in:'.implode(',',array_keys(UserOrderLog::$status))],
         ]);
         if(isset($data['media']) && !is_array($data['media'])){
             $this->error('视频必须是个数组');
@@ -281,12 +281,12 @@ class SenderOrderController extends SenderApi
         $data=input();
         $this->validate($data,[
             'id'=>['require'],
-            'fee_1'=>['require','egt:0'],
-            'fee_2'=>['require','egt:0'],
-            'fee_3'=>['require','egt:0'],
-            'fee_4'=>['require','egt:0'],
-            'fee_5'=>['require','egt:0'],
-            'fee_6'=>['require','egt:0'],
+            'fee_1|取件费'=>['require','egt:0'],
+            'fee_2|运输费'=>['require','egt:0'],
+            'fee_3|派送费'=>['require','egt:0'],
+            'fee_4|笼具费'=>['require','egt:0'],
+            'fee_5|寄养费'=>['require','egt:0'],
+            'fee_6|填写其它费'=>['require','egt:0'],
         ]);
         $user=$this->auth->getUser();
         Db::startTrans();

+ 2 - 2
application/api/controller/User.php

@@ -165,7 +165,7 @@ class User extends Api
         $code = $this->request->post('code');
         $type = $this->request->post('type');
         $this->validate(input(),[
-            'type'=>['require','in:1,2'],
+            'type|用户类型'=>['require','in:1,2'],
         ]);
         if (!$username || !$password) {
             $this->error(__('Invalid parameters'));
@@ -417,7 +417,7 @@ class User extends Api
         $data=input();
         $this->validate($data,[
             'code'=>'require',
-            'type'=>'require|in:1,2',
+            'type|用户类型'=>'require|in:1,2',
         ]);
         $session=Mini::mini($data['type'])->auth->session($data['code']);
         $decryptedData = Mini::mini($data['type'])->encryptor->decryptData($session, $data['iv'], $data['encryptedData']);

+ 5 - 5
application/api/controller/UserAddressController.php

@@ -45,14 +45,14 @@ class UserAddressController extends UserApi
         $user=$this->auth->getUser();
         $data=input();
         $this->validate($data,[
-            'name'=>'require|max:5',
-            'mobile'=>'require|number',
+            'name|姓名'=>'require|max:5',
+            'mobile|手机号'=>'require|number',
             //'city'=>'require',
             //'address'=>'require',
             //'location'=>'require',
-            'longitude'=>'require|float',
-            'latitude'=>'require|float',
-            'is_default'=>'require|in:0,1',
+            'longitude|经度'=>'require|float',
+            'latitude|纬度'=>'require|float',
+            'is_default|是否默认'=>'require|in:0,1',
         ]);
         if(!empty($data['id'])){
             $address=$user->address()->findOrFail($data['id']);

+ 1 - 1
application/api/controller/UserMoneyController.php

@@ -62,7 +62,7 @@ class UserMoneyController extends Api
     public function take_cash(){
         $data=input();
         $this->validate($data,[
-            'money'=>['require','integer','gt:0'],
+            'money|金额'=>['require','integer','gt:0'],
         ]);
         $user=$this->auth->getUser();
         Db::startTrans();