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

Merge branch 'master' into dev

shichen месяцев назад: 2
Родитель
Сommit
223b21db52

+ 1 - 1
app/command/WiwibaoProductSync.php

@@ -431,7 +431,7 @@ class WiwibaoProductSync extends Command
431 431
      */
432 432
     protected function calculateCostPrice($platPrice)
433 433
     {
434
-        return bcadd((string)$platPrice, bcmul((string)$platPrice, '0.23', 4), 2);
434
+        return bcadd((string)$platPrice, bcmul((string)$platPrice, '0.73', 4), 2);
435 435
     }
436 436
 
437 437
     /**

+ 21 - 13
app/common/repositories/store/order/StoreOrderRepository.php

@@ -2631,6 +2631,9 @@ class StoreOrderRepository extends BaseRepository
2631 2631
                     'specId' => $cart['productAttr']['spec_id'],
2632 2632
                     'quantity' => $cart['cart_num']
2633 2633
                 ];
2634
+                if (!$cart['product']['spu_id'] || !$cart['productAttr']['spec_id']) {
2635
+                    throw new ValidateException('1688预下单接口请求失败');
2636
+                }
2634 2637
                 $orderService = new OrderService();
2635 2638
                 $ailOrder = $orderService->previewOrder(['cargoParamList' => $cargoParamList, 'addressParam' => $addressParam]);
2636 2639
                 if ($ailOrder['preview']['sumCarriage'] > 0) {
@@ -5212,7 +5215,7 @@ class StoreOrderRepository extends BaseRepository
5212 5215
                     return $query->field('service_id,nickname');
5213 5216
                 }, 'user' => function ($query) {
5214 5217
                     return $query->field('uid,phone,nickname');
5215
-                }, 'userPvLog', 'sharedProsperityRewardRecord'
5218
+                }, 'userPvLog', 'sharedProsperityRewardRecord','groupOrder'
5216 5219
             ]);
5217 5220
         $query1 = clone ($query);
5218 5221
         $query2 = clone ($query);
@@ -11692,7 +11695,8 @@ class StoreOrderRepository extends BaseRepository
11692 11695
 
11693 11696
             // 为消费者 初始化 添加养老金记录
11694 11697
             if (is_null($yanglaojin)) {
11695
-                $yanglaojin = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11698
+                $goodPrice = bcsub($storeOrderEntity->getTotalPrice(),$storeOrderEntity->getTotalPostage(),CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11699
+                $yanglaojin = bcmul($goodPrice, CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11696 11700
             }
11697 11701
             /** @var UserBillRepository $userBillRepository */
11698 11702
             $userBillRepository = app()->make(UserBillRepository::class);
@@ -12105,17 +12109,21 @@ class StoreOrderRepository extends BaseRepository
12105 12109
             }
12106 12110
         }
12107 12111
 
12108
-        $withdrawalLimit = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::WITHDRAWAL_LIMIT_RATIO, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
12109
-        /** @var UserWithdrawalLimitRecordRepository $userWithdrawalLimitRecordRepository */
12110
-        $userWithdrawalLimitRecordRepository = app()->make(UserWithdrawalLimitRecordRepository::class);
12111
-        $userWithdrawalLimitRecordRepository->addUserWithdrawalLimitRecord(
12112
-            $userEntity->getUid(),
12113
-            UserWithdrawalLimitRecordEnum::PM['INCOME']['code'],
12114
-            $withdrawalLimit,
12115
-            UserWithdrawalLimitRecordEnum::TYPE_SHOP['Platform']['code'],
12116
-            $storeOrderEntity->getOrderSn(),
12117
-            '消费获得提现额度'
12118
-        );
12112
+
12113
+        // 复购区不给提现额度
12114
+        if ($storeOrderEntity->getMerId() != CommonEnum::DESIGN_MERCHANT_ID['Repurchase']['code']) {
12115
+            $withdrawalLimit = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::WITHDRAWAL_LIMIT_RATIO, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
12116
+            /** @var UserWithdrawalLimitRecordRepository $userWithdrawalLimitRecordRepository */
12117
+            $userWithdrawalLimitRecordRepository = app()->make(UserWithdrawalLimitRecordRepository::class);
12118
+            $userWithdrawalLimitRecordRepository->addUserWithdrawalLimitRecord(
12119
+                $userEntity->getUid(),
12120
+                UserWithdrawalLimitRecordEnum::PM['INCOME']['code'],
12121
+                $withdrawalLimit,
12122
+                UserWithdrawalLimitRecordEnum::TYPE_SHOP['Platform']['code'],
12123
+                $storeOrderEntity->getOrderSn(),
12124
+                '消费获得提现额度'
12125
+            );
12126
+        }
12119 12127
     }
12120 12128
 
12121 12129
     /**

+ 1 - 1
app/common/repositories/store/product/ProductAttrValueRepository.php

@@ -137,7 +137,7 @@ class ProductAttrValueRepository extends BaseRepository
137 137
         //查询商品上下架
138 138
         $goods_status = GongApiRequest::goods_status($spu_id);
139 139
         if(!isset($goods_status['status']) || $goods_status['status'] != 1){
140
-            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品已下架'.json_encode($goods_status)]);
140
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品已下架111'.json_encode($goods_status)]);
141 141
             if($delivery){
142 142
                 return false;
143 143
             }else{

+ 12 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -503,6 +503,8 @@ class ProductRepository extends BaseRepository
503 503
                         'gong_mer_profit' => $value['gong_mer_profit'] ?? 0.00,
504 504
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
505 505
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
506
+                        'sku_id' => $value['sku_id'] ?? null,
507
+                        'spec_id' => $value['spec_id'] ?? null,
506 508
                     ];
507 509
                 }
508 510
                 if (!$pric) $pric = $value['price'];
@@ -998,7 +1000,7 @@ class ProductRepository extends BaseRepository
998 1000
      */
999 1001
     public function detail($id, $userInfo)
1000 1002
     {
1001
-        $field = 'product_id,mer_id,image,slider_image,store_name,store_info,unit_name,price,cost,ot_price,stock,sales,ficti,video_link,product_type,type,dc_price,seckill,spu_id';
1003
+        $field = 'product_id,mer_id,image,slider_image,store_name,store_info,unit_name,price,cost,ot_price,stock,sales,ficti,video_link,product_type,type,dc_price,seckill,spu_id,pension_is,pension';
1002 1004
         $with = [
1003 1005
             'attr', 'attrValue', 'content', 'topReply.orderProduct' => function ($query) {
1004 1006
                 $query->field('reply_id,uid,nickname,merchant_reply_content,avatar,order_product_id,product_id,product_score,service_score,postage_score,comment,pics,create_time');
@@ -1097,6 +1099,11 @@ class ProductRepository extends BaseRepository
1097 1099
 
1098 1100
         }
1099 1101
 
1102
+        // 显示单独设置的养老金
1103
+        if ($res['pension_is'] != 0) {
1104
+            $res['yanglao'] = $res['pension'];
1105
+        }
1106
+
1100 1107
         $res['pv']=($k['pv']);
1101 1108
         $res['jifen']=($k['jifen']);
1102 1109
         $res['gongxian']=($k['gongxian']);
@@ -1893,6 +1900,10 @@ class ProductRepository extends BaseRepository
1893 1900
                     }
1894 1901
                 }
1895 1902
             }
1903
+
1904
+            if ($product['pension_is'] != 0) {
1905
+                $yanglao = $product['pension'];
1906
+            }
1896 1907
         }else{//线下商品
1897 1908
 
1898 1909
             if ($mer_id>0){

+ 10 - 10
app/controller/api/shareProsperity/Task.php

@@ -474,15 +474,15 @@ class Task
474 474
         // 李玉芝 238元,
475 475
         // 其他5人,每人68元
476 476
         $userData = [
477
-            192 => 1280,
477
+            192 => 1680,
478 478
             62 => 380,
479
-            43 => 158,
480
-            2393 => 238,
481
-            3 => 58,
482
-            4001 => 58,
483
-            4073 => 58,
484
-            2540 => 58,
485
-            4899 => 58,
479
+            43 => 28.57,
480
+            2393 => 28.57,
481
+            3 => 28.57,
482
+            4001 => 28.57,
483
+            4073 => 28.57,
484
+            2540 => 28.57,
485
+            4899 => 28.57,
486 486
         ];
487 487
 
488 488
         foreach ($userData as $uid => $money) {
@@ -579,10 +579,10 @@ class Task
579 579
         ];
580 580
         $money = [
581 581
             1 => 1.86,
582
-            2 => 3.73,
582
+            2 => 3.64,
583 583
             3 => 9.52,
584 584
             4 => 17.5,
585
-            5 => 22.22,
585
+            5 => 28.57,
586 586
         ];
587 587
         $groupUser = Db::name('shared_prosperity_user')->where('partner_level', $level)->select()->toArray();
588 588
         $userData = array_column($groupUser, 'user_id');

+ 3 - 2
app/controller/api/store/product/Jd.php

@@ -557,7 +557,8 @@ class Jd extends BaseController
557 557
                 } while ($page <= $maxPage);
558 558
                 Db::commit();
559 559
             } catch (DbException $e) {
560
-                Db::startTrans();
560
+                Db::rollback();
561
+                Log::info("JD API error : " . $e->getMessage());
561 562
             }
562 563
         }
563 564
 
@@ -576,7 +577,7 @@ class Jd extends BaseController
576 577
         ];
577 578
         $result = $this->getUrlResult($apiName, $params);
578 579
         $result = json_decode($result, true);
579
-
580
+        Log::info("JD API result (eliteId:{$eliteId}, page:{$page}): " . json_encode($result));
580 581
         $result = json_decode($result['jd_union_open_goods_jingfen_query_responce']['queryResult'], true);
581 582
         //        $result = $result['data'] ?? [];
582 583
         return $result;

+ 2 - 2
app/services/ThirdParty/AlibabaAgent/ProductService.php

@@ -369,14 +369,14 @@ class ProductService extends AlibabaAgentBaseService
369 369
     // ================================================================
370 370
 
371 371
     /**
372
-     * 对价格进行加价处理(加价50%)
372
+     * 对价格进行加价处理(加价20%)
373 373
      *
374 374
      * @param float $price 原价
375 375
      * @return float 加价后的价格
376 376
      */
377 377
     protected function applyMarkup(float $price): float
378 378
     {
379
-        return round($price * 1.5, 2);
379
+        return round($price * 1.2, 2);
380 380
     }
381 381
 
382 382
     // ================================================================