|
|
@@ -618,17 +618,17 @@ class StoreOrder extends AuthController
|
|
|
// 检查是否有add_time为今天0点时间戳的数据
|
|
|
$today_start_timestamp = strtotime('today midnight');
|
|
|
$award_lake = AwardLake::where('add_time', $today_start_timestamp)->find();
|
|
|
- @file_put_contents('quanju.txt', json_encode($award_lake)."-每日奖池\r\n", 8);
|
|
|
+ @file_put_contents('quanju.txt', json_encode($award_lake)."-每日奖池1\r\n", 8);
|
|
|
|
|
|
if ($award_lake) {
|
|
|
// 如果有,则将$order['total_price']的值加到num字段上
|
|
|
- $new_num = bcsub($award_lake->num, $product['refund_price'], 2);
|
|
|
+ $new_num = bcsub($award_lake->num, $data['refund_price'], 2);
|
|
|
AwardLake::where('id', $award_lake->id)->update(['num' => $new_num]);
|
|
|
} else {
|
|
|
// 如果没有,则新建一条数据
|
|
|
$id=AwardLake::create([
|
|
|
'add_time' => $today_start_timestamp,
|
|
|
- 'num' =>bcmul($product['refund_price'], -1, 2),
|
|
|
+ 'num' =>bcmul($data['refund_price'], -1, 2),
|
|
|
'update_time' => time()
|
|
|
]);
|
|
|
@file_put_contents('quanju.txt', json_encode($id)."-新增每日奖池\r\n", 8);
|