Browse Source

Wesmiler OTC 提交更新 0729

APPLE 3 năm trước cách đây
mục cha
commit
df25e3ed99

+ 1 - 1
app/Http/Controllers/Admin/AdvertController.php

@@ -29,7 +29,7 @@ class AdvertController extends Backend
         $pageSize = request()->post('limit', 15);
         $params = request()->all();
         if($this->userInfo['user_type'] == 2){
-            $params['business_id'] = $this->userInfo['user_id'];
+            $params['user_id'] = $this->userInfo['user_id'];
         }
         $list = AdvertService::make()->getDataList($params, $pageSize);
         $message = array(

+ 1 - 3
app/Services/Api/AdvertService.php

@@ -66,7 +66,7 @@ class AdvertService extends BaseService
             $where['type'] = $type;
         }
         $list = $this->model->from('advert as a')
-            ->leftJoin('member as m', 'm.id', '=', 'a.business_id')
+            ->leftJoin('member as m', 'm.id', '=', 'a.user_id')
             ->where($where)
             ->where('a.expired_at', '>', date('Y-m-d H:i:s'))
             ->select(['a.*', 'm.username'])
@@ -101,6 +101,4 @@ class AdvertService extends BaseService
         ];
     }
 
-
-
 }

+ 3 - 3
app/Services/Common/AdvertOrderService.php

@@ -180,8 +180,8 @@ class AdvertOrderService extends BaseService
         $tradeType = isset($info['type'])? $info['type'] : 0;
         $priceType = isset($info['price_type'])? $info['price_type'] : 0;
         $price = isset($info['price'])? $info['price'] : 0;
-        $businessId = isset($info['business_id'])? $info['business_id'] : 0;
-        if(empty($info) || $info['status'] != 1){
+        $businessId = isset($info['user_id'])? $info['user_id'] : 0;
+        if(empty($info) || $info['status'] != 1 || $businessId<=0){
             $this->error = '4001';
             return false;
         }
@@ -371,7 +371,7 @@ class AdvertOrderService extends BaseService
         $tradeType = isset($info['type'])? $info['type'] : 0;
         $priceType = isset($info['price_type'])? $info['price_type'] : 0;
         $price = isset($info['price'])? $info['price'] : 0;
-        $businessId = isset($info['business_id'])? $info['business_id'] : 0;
+        $businessId = isset($info['user_id'])? $info['user_id'] : 0;
         if(empty($info) || $info['status'] != 1){
             $this->error = '4001';
             return false;

+ 13 - 5
app/Services/Common/AdvertService.php

@@ -59,15 +59,23 @@ class AdvertService extends BaseService
     {
         $where = ['a.mark' => 1];
         $type = isset($params['type'])? $params['type'] : 1;
-        $businessId = isset($params['business_id'])? $params['business_id'] : 0;
+        $status = isset($params['status'])? $params['status'] : 0;
+        $advertType = isset($params['advert_type'])? $params['advert_type'] : 1;
+        $userId = isset($params['user_id'])? $params['user_id'] : 0;
         if($type>0){
             $where['a.type'] = $type;
         }
-        if($businessId>0){
-            $where['a.business_id'] = $businessId;
+        if($status>0){
+            $where['a.status'] = $status;
+        }
+        if($advertType>0){
+            $where['a.advert_type'] = $advertType;
+        }
+        if($userId>0){
+            $where['a.user_id'] = $userId;
         }
         $list = $this->model->from('advert as a')
-            ->leftJoin('member as m', 'm.id', '=', 'a.business_id')
+            ->leftJoin('member as m', 'm.id', '=', 'a.user_id')
             ->where($where)
             ->where('a.expired_at', '>', date('Y-m-d H:i:s'))
             ->select(['a.*', 'm.username','m.realname'])
@@ -144,7 +152,7 @@ class AdvertService extends BaseService
         if ($data['pay_type']) {
             $data['pay_type'] = implode(',', $data['pay_type']);
         }
-        $data['business_id'] = $userId;
+        $data['user_id'] = $userId;
         return parent::edit($data); // TODO: Change the autogenerated stub
     }