完成
This commit is contained in:
@@ -36,6 +36,14 @@ class QuerySmsStatus extends Command
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
// 一条短信的价格
|
||||
$sms_price = Db::table('sys_params')->where(['param_code' => 'sms_fee'])->column('param_value');
|
||||
if(!$sms_price) {
|
||||
Log::info('短信价格未定,停止发送');
|
||||
return false;
|
||||
}else {
|
||||
$sms_price = $sms_price[0];
|
||||
}
|
||||
$push_resp = '';
|
||||
// 生日有礼
|
||||
$bir_list = Db::table('mk_birthday_gift_record')->where(['push_status' => 'await_push'])->select()->toArray();
|
||||
@@ -56,7 +64,7 @@ class QuerySmsStatus extends Command
|
||||
if($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 3) {
|
||||
$push_status = 'success';
|
||||
// 扣掉余额
|
||||
ShopInfo::moeny(config('cons.sms_price'), $value['main_shop_id'], '生日有礼短信发送,任务ID:' . $value['id'], 2);
|
||||
ShopInfo::moeny($sms_price, $value['main_shop_id'], '生日有礼短信发送,任务ID:' . $value['id'], 2);
|
||||
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 2) {
|
||||
$push_resp = $res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['ErrCode'];
|
||||
$push_status = 'failed';
|
||||
@@ -100,7 +108,7 @@ class QuerySmsStatus extends Command
|
||||
if($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 3) {
|
||||
$push_status = 2;
|
||||
// 扣掉余额
|
||||
ShopInfo::moeny(config('cons.sms_price'), $value['main_shop_id'], '营销短信发送,任务ID:' . $value['event_id'], 2);
|
||||
ShopInfo::moeny($sms_price, $value['main_shop_id'], '营销短信发送,任务ID:' . $value['event_id'], 2);
|
||||
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 2) {
|
||||
$push_resp = $res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['ErrCode'];
|
||||
$push_status = -1;
|
||||
@@ -123,10 +131,6 @@ class QuerySmsStatus extends Command
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user