Просмотр исходного кода

Wesmiler OTC 提交更新 0729

APPLE 3 лет назад
Родитель
Сommit
5e5d010c10

+ 19 - 0
app/Http/Controllers/Api/AdvertController.php

@@ -45,4 +45,23 @@ class AdvertController extends webApp
         }
     }
 
+    /**
+     * 出售广告
+     * @param AdvertValidator $validate
+     * @return array
+     */
+    public function sell(AdvertValidator $validate)
+    {
+        $params = request()->post();
+        $params = $validate->check($params,'sell');
+        if(!is_array($params)){
+            return message($params, false,[]);
+        }
+
+        if(!AdvertOrderService::make()->sell($this->userId, $params)){
+            return message(AdvertOrderService::make()->getError(), false);
+        }else{
+            return message(AdvertOrderService::make()->getError(), true);
+        }
+    }
 }

+ 1 - 1
app/Http/Controllers/Api/TestController.php

@@ -29,7 +29,7 @@ class TestController extends webApp
     public function index()
     {
 
-        echo getChatKey(10005,10003);
+        echo preg_match('/^[\x{4e00}-\x{9fa5}]{2,5}$/u','大的');
 
 
         return false;

+ 2 - 1
app/Http/Validator/AdvertValidator.php

@@ -39,7 +39,8 @@ class AdvertValidator extends BaseValidator
     // 当前模型所有验证场景
     public static $scenes = [
         'info'=> ['id'],
-        'buy'=> ['id','type','pay_type','price_type'],
+        'buy'=> ['id','type','pay_type','num','trade_password'],
+        'sell'=> ['id','type','payment_id','num','trade_password'],
     ];
 
     /**