Browse Source

一些功能

Kirin 3 năm trước cách đây
mục cha
commit
91385c97ff

+ 6 - 3
crmeb/repositories/OrderRepository.php

@@ -106,11 +106,12 @@ class OrderRepository
         $res1 = StoreOrder::gainUserIntegral($order);
 //        $res2 = User::backOrderBrokerage($order);
         $res2 = User::sendBackOrderBrokerage($order);
+        $res3 = StoreOrder::treatmentAward($order['id']);
         StoreOrder::orderTakeAfter($order);
         StoreOrder::where('id', $order['id'])->update(['arrive_time' => time()]);
         //满赠优惠券
         WechatUser::userTakeOrderGiveCoupon($uid, $order['total_price']);
-        if (!($res1 && $res2)) exception('收货失败!');
+        if (!($res1 && $res2 && $res3)) exception('收货失败!');
     }
 
     /**
@@ -124,9 +125,10 @@ class OrderRepository
         $res1 = AdminStoreOrder::gainUserIntegral($order);
 //        $res2 = User::backOrderBrokerage($order);
         $res2 = User::sendBackOrderBrokerage($order);
+        $res3 = StoreOrder::treatmentAward($order['id']);
         AdminStoreOrder::orderTakeAfter($order);
         StoreOrder::where('id', $order['id'])->update(['arrive_time' => time()]);
-        if (!($res1 && $res2)) exception('收货失败!');
+        if (!($res1 && $res2 && $res3)) exception('收货失败!');
     }
 
     /**
@@ -139,9 +141,10 @@ class OrderRepository
 
         $res1 = AdminStoreOrder::gainUserIntegral($order, false);
         $res2 = User::sendBackOrderBrokerage($order);
+        $res3 = StoreOrder::treatmentAward($order['id']);
         AdminStoreOrder::orderTakeAfter($order);
         StoreOrder::where('id', $order['id'])->update(['arrive_time' => time()]);
-        if (!($res1 && $res2)) exception('收货失败!');
+        if (!($res1 && $res2 && $res3)) exception('收货失败!');
     }
 
 

+ 4 - 0
vendor/overtrue/wechat/src/Payment/API.php

@@ -74,6 +74,10 @@ class API extends AbstractAPI
     const API_QUERY_REFUND = '/pay/refundquery';
     const API_DOWNLOAD_BILL = '/pay/downloadbill';
     const API_REPORT = '/payitil/report';
+    const API_PROFITSHARING = '/secapi/pay/profitsharing';
+    const API_MULTI_PROFIT_SHARING = '/secapi/pay/multiprofitsharing';
+    const API_PROFIT_SHARING_ADD_RECEIVER = '/secapi/pay/profitsharingaddreceiver';
+    const API_PROFIT_SHARING_FINISH = '/secapi/pay/profitsharingfinish';
 
     const API_URL_SHORTEN = 'https://api.mch.weixin.qq.com/tools/shorturl';
     const API_AUTH_CODE_TO_OPENID = 'https://api.mch.weixin.qq.com/tools/authcodetoopenid';