完成
This commit is contained in:
@@ -17,6 +17,14 @@ class BirthdayGiftSms implements Consumer
|
||||
public function consume($data)
|
||||
{
|
||||
Log::info('消息队列【生日有礼】接收到消息' . $data);
|
||||
// 一条短信的价格
|
||||
$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];
|
||||
}
|
||||
if($data) {
|
||||
$record = Db::table('mk_birthday_gift_record')->where(['id' => $data])->find();
|
||||
if($record) {
|
||||
@@ -29,7 +37,7 @@ class BirthdayGiftSms implements Consumer
|
||||
$shop_money = Db::table('sms_shop_money')->where(['shop_id' => $record['main_shop_id']])->find();
|
||||
if($shop_money) {
|
||||
// 余额计算
|
||||
if($shop_money['money'] > config('cons.sms_price')) {
|
||||
if($shop_money['money'] > $sms_price) {
|
||||
$templateParam = replace_json_keys($record['template_content'], $y_temp['content_json'], $user);
|
||||
$data = [
|
||||
'templateCode' => $record['template_code'],
|
||||
|
||||
@@ -31,6 +31,13 @@ class SendMarkSms implements Consumer
|
||||
Log::info('send.mark.sms数据格式错误');
|
||||
return false;
|
||||
}
|
||||
$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];
|
||||
}
|
||||
if($data) {
|
||||
Log::info('$data');
|
||||
// 发送任务
|
||||
@@ -74,7 +81,7 @@ class SendMarkSms implements Consumer
|
||||
$shop_money = Db::table('sms_shop_money')->where(['shop_id' => $record['shop_id']])->find();
|
||||
if($shop_money) {
|
||||
// 余额计算
|
||||
if($shop_money['money'] > config('cons.sms_price')) {
|
||||
if($shop_money['money'] > $sms_price) {
|
||||
$templateParam = replace_json_keys($record['json'], $y_temp['content_json'], $v);
|
||||
$data = [
|
||||
'templateCode' => $y_temp['template_code'],
|
||||
|
||||
Reference in New Issue
Block a user