Procházet zdrojové kódy

Merge branch 'master' into huangfamily

family před 1 rokem
rodič
revize
deec283605

+ 1 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -10689,6 +10689,6 @@ class StoreOrderRepository extends BaseRepository
10689 10689
         //{"user_groub":6,"rate":15,"name":"高级合伙人"},
10690 10690
         //{"user_groub":7,"rate":17,"name":"董事"}
10691 10691
         //]
10692
-        return isset($group_rate[$spread_data['user_group']]) ? round($group_rate[$user_group] / 100, 2) : 0.00;
10692
+        return isset($group_rate[$user_group]) ? round($group_rate[$user_group] / 100, 2) : 0.00;
10693 10693
     }
10694 10694
 }

+ 7 - 5
app/common/repositories/store/product/ProductRepository.php

@@ -49,7 +49,7 @@ class ProductRepository extends BaseRepository
49 49
 {
50 50
 
51 51
     protected $dao;
52
-    protected $filed = 'concession_pri,product_id,mer_id,brand_id,unit_name,rate,reply_count,store_info,cate_id,ficti,image,slider_image,store_name,keyword,sort,is_show,sales,price,refusal,cost,ot_price,stock,is_gift_bag,care_count,status,is_used,create_time,seckill,plate_mer_profit,type';
52
+    protected $filed = 'is_status,concession_pri,product_id,mer_id,brand_id,unit_name,rate,reply_count,store_info,cate_id,ficti,image,slider_image,store_name,keyword,sort,is_show,sales,price,refusal,cost,ot_price,stock,is_gift_bag,care_count,status,is_used,create_time,seckill,plate_mer_profit,type';
53 53
 
54 54
     /**
55 55
      * ProductRepository constructor.
@@ -1944,16 +1944,18 @@ class ProductRepository extends BaseRepository
1944 1944
                 ->where('product_id', $product_id)
1945 1945
                 ->select()->toArray();
1946 1946
             $attrInfo = array_column($attrInfo, null, 'gong_sku_id');
1947
-            $updateData = [];
1947
+            $updateData = [];   
1948 1948
             // 组装数据
1949 1949
             foreach ($skuArr as $key => $value) {
1950 1950
                 if (isset($attrInfo[$value['sku_id']])) {
1951
+
1951 1952
                     if ($value['edit_price'] > $attrInfo[$value['sku_id']]['gong_market_price']) {
1952 1953
                         // 上调价格计算创客利润
1953 1954
                         $diff = bcsub($value['edit_price'], $attrInfo[$value['sku_id']]['gong_market_price'], 2);
1954
-                        $diff_profit = bcmul($diff, 0.7, 2);
1955
+                        // $diff_profit = bcmul($diff, 0.7, 2);
1956
+                        $diff_profit = $diff;
1955 1957
                         $plate_mer_profit = bcadd($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff_profit, 2);
1956
-                    } else {
1958
+                    } else {    
1957 1959
                         // 下调价格计算创客利润
1958 1960
                         $diff = bcsub($attrInfo[$value['sku_id']]['gong_market_price'], $value['edit_price'], 2);
1959 1961
                         $plate_mer_profit = bcsub($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff, 2);
@@ -2041,7 +2043,7 @@ class ProductRepository extends BaseRepository
2041 2043
     // 供应链商品上下架
2042 2044
     public function changeStatus($ids, $is_show)
2043 2045
     {
2044
-        $data = ['is_show' => $is_show];
2046
+        $data = ['is_show' => $is_show, 'is_status' => 1];
2045 2047
         $this->dao->updates($ids, $data);
2046 2048
 
2047 2049
         foreach ($ids as $id) {

+ 5 - 2
app/controller/api/douhuomall/Take.php

@@ -94,8 +94,9 @@ class Take
94 94
             $this->remove($goodsIds);
95 95
             return 'sussess';
96 96
         } catch (Exception $e) {
97
-            Log::error('同步数据失败:' . $e->getMessage());
97
+            Log::error('供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】');
98 98
             echo '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】';
99
+            Db::name('log')->insert(['data' => '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】']);
99 100
             return 'error';
100 101
         }
101 102
     }
@@ -124,9 +125,11 @@ class Take
124 125
         if (!is_dir($targetDir)) {
125 126
             mkdir($targetDir, 0777, true); // 第二个参数是权限,第三个参数是递归创建
126 127
         }
128
+
129
+        ini_set("max_execution_time", 2);
127 130
         
128 131
         // 获取远程图片内容
129
-        $imageContent = file_get_contents($remoteImageUrl);
132
+        $imageContent = @file_get_contents($remoteImageUrl);
130 133
         
131 134
         // 检查是否成功获取内容
132 135
         if ($imageContent !== false) {

+ 4 - 4
app/controller/merchant/gong/Goods.php

@@ -320,10 +320,10 @@ class Goods extends BaseController
320 320
                     'cost_price'=>$v['cost_price'],
321 321
                     'extension_one'=>5,
322 322
                     'gong_sku_id'=>$v['sku_id'],
323
-                    'gong_mer_profit' => $v['profit'],
323
+                    'gong_mer_profit' => $v['mer_profit'],
324 324
                     'gong_pension' => $v['yanglaojin'],
325 325
                     'gong_market_price' => $v['market_price'],
326
-                    'plate_mer_profit' => $v['profit']
326
+                    'plate_mer_profit' => $v['mer_profit']
327 327
                 ]);
328 328
                 $key='';
329 329
                 $num++;
@@ -357,10 +357,10 @@ class Goods extends BaseController
357 357
                     'cost_price'=>$v['cost_price'],
358 358
                     'extension_one'=>5,
359 359
                     'gong_sku_id'=>$v['sku_id'],
360
-                    'gong_mer_profit' => $v['profit'],
360
+                    'gong_mer_profit' => $v['mer_profit'],
361 361
                     'gong_pension' => $v['yanglaojin'],
362 362
                     'gong_market_price' => $v['market_price'],
363
-                    'plate_mer_profit' => $v['profit']
363
+                    'plate_mer_profit' => $v['mer_profit']
364 364
                 ]);
365 365
                 $key='';
366 366
                 $num++;