liugc пре 1 година
родитељ
комит
01cbe029df

+ 2 - 0
app/adminapi/logic/goods/GoodsLogic.php

@@ -93,6 +93,7 @@ class GoodsLogic extends BaseLogic
                 'labels' => (isset($params['labels']) && $params['labels'])?implode(',',$params['labels']):'',
                 'activity_service_fee' => $params['activity_service_fee'] ??'',
                 'sell_num'=>!empty($params['sell_num'])?$params['sell_num']:0,
+                'platform_value'=>$params['platform_value']??0,
             ]);
 
             //更新绩效规则
@@ -191,6 +192,7 @@ class GoodsLogic extends BaseLogic
                 'labels' => (isset($params['labels']) && $params['labels'])?implode(',',$params['labels']):'',
                 'activity_service_fee' => $params['activity_service_fee'] ??'',
                 'sell_num'=>!empty($params['sell_num'])?$params['sell_num']:0,
+                'platform_value'=>$params['platform_value']??0,
             ]);
 
             //更新绩效规则

+ 1 - 0
app/api/lists/FirmGoodLists.php

@@ -43,6 +43,7 @@ class FirmGoodLists extends BaseApiDataLists implements ListsSearchInterface
     {
         $where = [];
         $where[] = ['user_id','=',$this->userId];
+        $where[] = ['platform_value','=',0];
         if (!empty($this->params['goods_category_id'])) {
             $goodsCategoryId = end($this->params['goods_category_id']);
             $goodsCategoryData = GoodsCategory::where(['status' => 1])->order(['pid' => 'asc', 'weigh' => 'desc', 'id' => 'desc'])

+ 1 - 0
app/api/lists/GoodsLists.php

@@ -50,6 +50,7 @@ class GoodsLists  extends BaseApiDataLists implements ListsSearchInterface
         $where = [];
         $where['user_id'] = 0;//常规商品
         $where['is_agent'] = 0;//常规商品
+        $where['platform_value'] = 0;//自平台商品
         if (!empty($this->params['goods_category_id'])) {
             $goodsCategoryId = end($this->params['goods_category_id']);
             $goodsCategoryData = GoodsCategory::where(['status'=>1])->order(['pid' => 'asc','weigh' => 'desc', 'id' => 'desc'])

+ 4 - 4
app/api/logic/GoodsLogic.php

@@ -25,13 +25,13 @@ class GoodsLogic extends BaseLogic
      */
     public static function detail($id,$type){
         if($type == 'category'){
-            $goods = Goods::where(['goods_category_id'=>$id,'user_id'=>0,'is_agent'=>0,'is_activity'=>0])->visible([
+            $goods = Goods::where(['goods_category_id'=>$id,'user_id'=>0,'is_agent'=>0,'is_activity'=>0,'platform_value'=>0])->visible([
                 'id','goods_image','goods_name','goods_banners','good_unit','sell_num','base_service_fee',
                 'service_total','service_fee','service_image','fee_schedule','warranty_period','goods_payment_type','goods_category_id'
             ])->select()->toArray();
         }else{
             $goods_category_id = Goods::where('id',$id)->value('goods_category_id');
-            $goods = Goods::where(['goods_category_id'=>$goods_category_id,'user_id'=>0,'is_agent'=>0,'is_activity'=>0])->visible([
+            $goods = Goods::where(['goods_category_id'=>$goods_category_id,'user_id'=>0,'is_agent'=>0,'is_activity'=>0,'platform_value'=>0])->visible([
                 'id','goods_image','goods_name','goods_banners','good_unit','sell_num','base_service_fee',
                 'service_total','service_fee','service_image','fee_schedule','warranty_period','goods_payment_type','goods_category_id'
             ])->select()->toArray();
@@ -72,7 +72,7 @@ class GoodsLogic extends BaseLogic
     }
 
     public static function eventDetail($id,$userId){
-        $goods = Goods::where(['id'=>$id])->visible([
+        $goods = Goods::where(['id'=>$id])->where(['platform_value'=>0])->visible([
                 'id','goods_image','goods_name','goods_banners','good_unit','sell_num','base_service_fee',
                 'service_total','service_fee','service_image','fee_schedule','warranty_period','goods_payment_type','goods_category_id'
             ])->select()
@@ -122,7 +122,7 @@ class GoodsLogic extends BaseLogic
 
     public static function getHotData()
     {
-        return Goods::where(['user_id'=>0,'is_hot'=>1])
+        return Goods::where(['user_id'=>0,'is_hot'=>1,'platform_value'=>0])
             ->with('goodsCategory')
             ->visible(['id','goods_name','goods_image'])
             ->order(['top_weight' => 'desc', 'id' => 'desc'])