Merge branch 'dev' of 192.168.195.14:server/manghe into dev
This commit is contained in:
commit
6d85b8f528
|
|
@ -102,7 +102,7 @@ class FlwOpen extends Command
|
||||||
->toArray();
|
->toArray();
|
||||||
// 如果没有参与用户,直接返回
|
// 如果没有参与用户,直接返回
|
||||||
if (empty($all_order_list)) {
|
if (empty($all_order_list)) {
|
||||||
|
|
||||||
echo ('福利屋开奖完成没有用户参加, goods_id: ' . $goods_id) . PHP_EOL;
|
echo ('福利屋开奖完成没有用户参加, goods_id: ' . $goods_id) . PHP_EOL;
|
||||||
Goods::where(['id' => $goods_id])->update(['is_open' => 1, 'status' => 3]);
|
Goods::where(['id' => $goods_id])->update(['is_open' => 1, 'status' => 3]);
|
||||||
return $res;
|
return $res;
|
||||||
|
|
@ -110,7 +110,6 @@ class FlwOpen extends Command
|
||||||
|
|
||||||
// 打散参与用户
|
// 打散参与用户
|
||||||
shuffle($all_order_list);
|
shuffle($all_order_list);
|
||||||
shuffle($all_order_list);
|
|
||||||
$prize_index = 0;
|
$prize_index = 0;
|
||||||
$prize_count = count($goods_list_all);
|
$prize_count = count($goods_list_all);
|
||||||
|
|
||||||
|
|
@ -139,7 +138,10 @@ class FlwOpen extends Command
|
||||||
$order_info['goodslist_type'] = $prize['goods_type'];
|
$order_info['goodslist_type'] = $prize['goods_type'];
|
||||||
$order_info['shang_id'] = $prize['shang_id'];
|
$order_info['shang_id'] = $prize['shang_id'];
|
||||||
$order_info['prize_code'] = $prize['reward_id'];
|
$order_info['prize_code'] = $prize['reward_id'];
|
||||||
|
if ($order_info['status'] != 0 && $order_info['goodslist_type'] == 1) {
|
||||||
|
$order_info['status'] = 0;
|
||||||
|
$order_info['recovery_num'] = '';
|
||||||
|
}
|
||||||
// 减少库存
|
// 减少库存
|
||||||
$update_stock = GoodsList::where(['id' => $prize['id']])
|
$update_stock = GoodsList::where(['id' => $prize['id']])
|
||||||
->where('surplus_stock', '>', 0)
|
->where('surplus_stock', '>', 0)
|
||||||
|
|
@ -152,7 +154,7 @@ class FlwOpen extends Command
|
||||||
|
|
||||||
// 发放奖品
|
// 发放奖品
|
||||||
RewardService::sendReward($user['user_id'], $prize['reward_id'], $goods_title . '开奖');
|
RewardService::sendReward($user['user_id'], $prize['reward_id'], $goods_title . '开奖');
|
||||||
echo ('发放奖品成功 goods_id: ' . $goods_id . ', user_id: ' . $user['user_id'] . ', reward_id: ' . $prize['reward_id']) . PHP_EOL;
|
echo ('发放奖品成功 goods_id: ' . $goods_id . ', user_id: ' . $user['user_id'] . ', reward_id: ' . $prize['reward_id'] . ' 奖品名称:' . $prize['title']) . PHP_EOL;
|
||||||
$prize_index++;
|
$prize_index++;
|
||||||
} else {
|
} else {
|
||||||
// 轮空处理
|
// 轮空处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user