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

Merge branch 'master' into huangfamily

family 1 год назад
Родитель
Сommit
deec283605

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

@@ -10689,6 +10689,6 @@ class StoreOrderRepository extends BaseRepository
10689
         //{"user_groub":6,"rate":15,"name":"高级合伙人"},
10689
         //{"user_groub":6,"rate":15,"name":"高级合伙人"},
10690
         //{"user_groub":7,"rate":17,"name":"董事"}
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
     protected $dao;
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
      * ProductRepository constructor.
55
      * ProductRepository constructor.
@@ -1944,16 +1944,18 @@ class ProductRepository extends BaseRepository
1944
                 ->where('product_id', $product_id)
1944
                 ->where('product_id', $product_id)
1945
                 ->select()->toArray();
1945
                 ->select()->toArray();
1946
             $attrInfo = array_column($attrInfo, null, 'gong_sku_id');
1946
             $attrInfo = array_column($attrInfo, null, 'gong_sku_id');
1947
-            $updateData = [];
1947
+            $updateData = [];   
1948
             // 组装数据
1948
             // 组装数据
1949
             foreach ($skuArr as $key => $value) {
1949
             foreach ($skuArr as $key => $value) {
1950
                 if (isset($attrInfo[$value['sku_id']])) {
1950
                 if (isset($attrInfo[$value['sku_id']])) {
1951
+
1951
                     if ($value['edit_price'] > $attrInfo[$value['sku_id']]['gong_market_price']) {
1952
                     if ($value['edit_price'] > $attrInfo[$value['sku_id']]['gong_market_price']) {
1952
                         // 上调价格计算创客利润
1953
                         // 上调价格计算创客利润
1953
                         $diff = bcsub($value['edit_price'], $attrInfo[$value['sku_id']]['gong_market_price'], 2);
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
                         $plate_mer_profit = bcadd($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff_profit, 2);
1957
                         $plate_mer_profit = bcadd($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff_profit, 2);
1956
-                    } else {
1958
+                    } else {    
1957
                         // 下调价格计算创客利润
1959
                         // 下调价格计算创客利润
1958
                         $diff = bcsub($attrInfo[$value['sku_id']]['gong_market_price'], $value['edit_price'], 2);
1960
                         $diff = bcsub($attrInfo[$value['sku_id']]['gong_market_price'], $value['edit_price'], 2);
1959
                         $plate_mer_profit = bcsub($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff, 2);
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
     public function changeStatus($ids, $is_show)
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
         $this->dao->updates($ids, $data);
2047
         $this->dao->updates($ids, $data);
2046
 
2048
 
2047
         foreach ($ids as $id) {
2049
         foreach ($ids as $id) {

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

@@ -94,8 +94,9 @@ class Take
94
             $this->remove($goodsIds);
94
             $this->remove($goodsIds);
95
             return 'sussess';
95
             return 'sussess';
96
         } catch (Exception $e) {
96
         } catch (Exception $e) {
97
-            Log::error('同步数据失败:' . $e->getMessage());
97
+            Log::error('供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】');
98
             echo '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】';
98
             echo '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】';
99
+            Db::name('log')->insert(['data' => '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】']);
99
             return 'error';
100
             return 'error';
100
         }
101
         }
101
     }
102
     }
@@ -124,9 +125,11 @@ class Take
124
         if (!is_dir($targetDir)) {
125
         if (!is_dir($targetDir)) {
125
             mkdir($targetDir, 0777, true); // 第二个参数是权限,第三个参数是递归创建
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
         if ($imageContent !== false) {
135
         if ($imageContent !== false) {

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

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