完成
This commit is contained in:
@@ -48,11 +48,11 @@ class ApplySmsTemp extends Command
|
||||
// \support\Redis::setEx('expired:sms:9995', $stortime - time(), 1);
|
||||
// Log::info('定时发送,已存入redis');
|
||||
// p(123123);
|
||||
$host = RabbitMqConfig::$host;
|
||||
$port = RabbitMqConfig::$port;
|
||||
$user = RabbitMqConfig::$user;
|
||||
$password = RabbitMqConfig::$password;
|
||||
$queue = RabbitMqConfig::$queue_t . '-apply.sms.temp';
|
||||
$host = config('cons.mq.host');
|
||||
$port = config('cons.mq.port');
|
||||
$user = config('cons.mq.user');
|
||||
$password = config('cons.mq.password');
|
||||
$queue = config('cons.mq.queue_t') . '-apply.sms.temp';
|
||||
|
||||
// 防止空闲时间断线必须设置心跳
|
||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||
|
||||
@@ -38,11 +38,11 @@ class BirthdayGiftSms extends Command
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
|
||||
$host = RabbitMqConfig::$host;
|
||||
$port = RabbitMqConfig::$port;
|
||||
$user = RabbitMqConfig::$user;
|
||||
$password = RabbitMqConfig::$password;
|
||||
$queue = RabbitMqConfig::$queue_t . '-birthday.gift.sms';
|
||||
$host = config('cons.mq.host');
|
||||
$port = config('cons.mq.port');
|
||||
$user = config('cons.mq.user');
|
||||
$password = config('cons.mq.password');
|
||||
$queue = config('cons.mq.queue_t') . '-birthday.gift.sms';
|
||||
|
||||
// 防止空闲时间断线必须设置心跳
|
||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ class RabbOrderPrint extends Command
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
|
||||
$host = RabbitMqConfig::$host;
|
||||
$port = RabbitMqConfig::$port;
|
||||
$user = RabbitMqConfig::$user;
|
||||
$password = RabbitMqConfig::$password;
|
||||
$queue = RabbitMqConfig::$queue_t . '-order.print.queue';
|
||||
$host = config('cons.mq.host');
|
||||
$port = config('cons.mq.port');
|
||||
$user = config('cons.mq.user');
|
||||
$password = config('cons.mq.password');
|
||||
$queue = config('cons.mq.queue_t') . '-order.print.queue';
|
||||
|
||||
// 防止空闲时间断线必须设置心跳
|
||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||
|
||||
@@ -35,11 +35,11 @@ class RabbProductUpdate extends Command
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$host = RabbitMqConfig::$host;
|
||||
$port = RabbitMqConfig::$port;
|
||||
$user = RabbitMqConfig::$user;
|
||||
$password = RabbitMqConfig::$password;
|
||||
$queue = RabbitMqConfig::$queue_t . '-product.info.change.queue';
|
||||
$host = config('cons.mq.host');
|
||||
$port = config('cons.mq.port');
|
||||
$user = config('cons.mq.user');
|
||||
$password = config('cons.mq.password');
|
||||
$queue = config('cons.mq.queue_t') . '-product.info.change.queue';
|
||||
// 防止空闲时间断线必须设置心跳
|
||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||
'/',
|
||||
|
||||
Reference in New Issue
Block a user