|
|
@@ -1405,18 +1405,18 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
|
|
|
// 服务中心核销节能油进行分红
|
|
|
- public function confirmOil($order)
|
|
|
+ public function confirmOil($order,$service_id)
|
|
|
{
|
|
|
$price = app()->make(AwardIntegralPriceRepository::class)->awardIntegralPrice(); //分红积分价格
|
|
|
@file_put_contents('quanju.txt', json_encode($price) . "-积分金额3\r\n", 8);
|
|
|
$MerchantRepository = app()->make(MerchantRepository::class);
|
|
|
- $uid = Merchant::where('mer_id', $order['mer_id'])->value('uid');
|
|
|
- $award_integral = User::where('uid', $uid)->value('award_integral');
|
|
|
+// $uid = Merchant::where('mer_id', $order['mer_id'])->value('uid');
|
|
|
+ $award_integral = User::where('uid', $service_id)->value('award_integral');
|
|
|
$integral_prcie = app()->make(AwardIntegralPriceRepository::class)->getPrice(); //积分价格
|
|
|
$integral = bcmul(bcdiv(2, $integral_prcie['price'], 2), $order['total_num'], 2); //价值2元的积分
|
|
|
$make = app()->make(UserBillRepository::class);
|
|
|
$after = bcadd($award_integral, $integral, 2);
|
|
|
- $make->incBill($uid, 'award_integral', 'confirm_oil_integral', [
|
|
|
+ $make->incBill($service_id, 'award_integral', 'confirm_oil_integral', [
|
|
|
'number' => $integral,
|
|
|
'title' => '核销节能油获得分红积分',
|
|
|
'balance' => $after,
|
|
|
@@ -1424,7 +1424,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
'link_id' => $order['order_id'],
|
|
|
'mark' => '服务中心核销节能油获得分红积分' . $integral . '(积分价格:' . $price['price'] . ')',
|
|
|
]);
|
|
|
- User::where('uid', $uid)->update(['award_integral' => $after]);
|
|
|
+ User::where('uid', $service_id)->update(['award_integral' => $after]);
|
|
|
}
|
|
|
|
|
|
// 看看上级有没有冻结份额
|