|
|
@@ -1117,6 +1117,9 @@ class StoreOrderRepository extends BaseRepository
|
|
|
// 订单收货赠送分红额度
|
|
|
public function getOrderAward($order)
|
|
|
{
|
|
|
+ try {
|
|
|
+
|
|
|
+
|
|
|
$cartIdArray = explode(',', $order['cart_id']); // 使用逗号分割字符串
|
|
|
$product_id = StoreCart::where('cart_id', $cartIdArray[0])->value('product_id');
|
|
|
$storeProduct = app()->make(Product::class);
|
|
|
@@ -1271,14 +1274,19 @@ class StoreOrderRepository extends BaseRepository
|
|
|
@file_put_contents('quanju4.txt',"-支付能传到这里吗16\r\n",8);
|
|
|
$UserRepository = app()->make(UserRepository::class);
|
|
|
$UserRepository->checkAward($order['uid']);
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗20\r\n",8);
|
|
|
+
|
|
|
// 上级推荐奖励的分红积分
|
|
|
$this->getSpreadIntegral($order, $type, $user, $product_id);
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗21\r\n",8);
|
|
|
+
|
|
|
// 检测节能油或者礼包升级
|
|
|
// $AwardLake = app()->make(AwardLake::class);
|
|
|
$awardLake = app()->make(AwardLake::class);
|
|
|
if ($type == 5) {
|
|
|
$oil = app()->make(OilLevel::class);
|
|
|
$oil->checkLevel($order['uid']);
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗22\r\n",8);
|
|
|
|
|
|
// $ratio = systemConfig('energy_saving_oil_ratio', 10);
|
|
|
// @file_put_contents('quanju2.txt', $ratio . "-奖池比例12\r\n", 8);
|
|
|
@@ -1289,6 +1297,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
} elseif ($type == 6) {
|
|
|
$gift = app()->make(GiftLevel::class);
|
|
|
$gift->checkLevel($order['uid']);
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗23\r\n",8);
|
|
|
|
|
|
// $ratio = systemConfig('gift_pack_ratio', 10);
|
|
|
// @file_put_contents('quanju2.txt', $ratio . "-奖池比例\r\n", 8);
|
|
|
@@ -1301,9 +1310,13 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$award_brokerage = systemConfig('award_brokerage', 15);
|
|
|
$award_brokerage = bcdiv($award_brokerage,100,2);
|
|
|
if ($award_brokerage>0){
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗24\r\n",8);
|
|
|
+
|
|
|
$brokerage_price = User::where('uid', $user['uid'])->value('brokerage_price');
|
|
|
$order_award_brokerage = bcmul($order['pay_price'], $award_brokerage, 2);
|
|
|
if ($order_award_brokerage > 0) {
|
|
|
+ @file_put_contents('quanju4.txt',"-支付能传到这里吗25\r\n",8);
|
|
|
+
|
|
|
// $order_award_range = bcdiv($order_award_range, $price['price'], 2); //业绩除以积分价格得到分红积分
|
|
|
$after = bcadd($brokerage_price, $order_award_brokerage, 2);
|
|
|
$make->incBill($user['uid'], 'brokerage', 'order_brokerage', [
|
|
|
@@ -1317,9 +1330,14 @@ class StoreOrderRepository extends BaseRepository
|
|
|
User::where('uid', $user['uid'])->update(['brokerage_price' => $after]);
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
@file_put_contents('quanju4.txt',"-支付能传到这里吗17\r\n",8);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ @file_put_contents('quanju4.txt', $e->getMessage() . "-支付报错内容\r\n", 8);
|
|
|
+ @file_put_contents('quanju4.txt', $e->getFile() . "-文件\r\n", 8);
|
|
|
+ @file_put_contents('quanju4.txt', $e->getLine() . "-位置\r\n", 8);
|
|
|
+ }
|
|
|
|
|
|
- return true;
|
|
|
}
|
|
|
|
|
|
//礼包购买数
|