日志修改
This commit is contained in:
@@ -38,12 +38,12 @@ class ApplySmsTemp extends Command
|
|||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$str = '亲爱的${用户昵称}您好,${店铺名称}祝您生日快乐!感谢您一直的陪伴。为您准备了${数量}张超值优惠券,已放入账户,愿我们的礼物能为您增添一份喜悦。拒收请回复R';
|
// $str = '亲爱的${用户昵称}您好,${店铺名称}祝您生日快乐!感谢您一直的陪伴。为您准备了${数量}张超值优惠券,已放入账户,愿我们的礼物能为您增添一份喜悦。拒收请回复R';
|
||||||
$templateContent_arr = ShopInfo::handleSmsTemplates($str);
|
// $templateContent_arr = ShopInfo::handleSmsTemplates($str);
|
||||||
$a = '{"店铺名称":"火锅店","用户昵称":"嘿嘿","数量":"123"}';
|
// $a = '{"店铺名称":"火锅店","用户昵称":"嘿嘿","数量":"123"}';
|
||||||
p(replace_json_keys($a, json_encode($templateContent_arr, 256), []));
|
// p(replace_json_keys($a, json_encode($templateContent_arr, 256), []));
|
||||||
$t_str = replace_placeholder_keys($str, $templateContent_arr);
|
// $t_str = replace_placeholder_keys($str, $templateContent_arr);
|
||||||
p($templateContent_arr, $t_str);
|
// p($templateContent_arr, $t_str);
|
||||||
|
|
||||||
|
|
||||||
$host = RabbitMqConfig::$host;
|
$host = RabbitMqConfig::$host;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class QuerySmsStatus extends Command
|
|||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
// 生日有礼
|
// 生日有礼
|
||||||
$bir_list = Db::table('mk_birthday_gift_record')->where(['status' => 'await_push'])->select()->toArray();
|
$bir_list = Db::table('mk_birthday_gift_record')->where(['push_status' => 'await_push'])->select()->toArray();
|
||||||
if($bir_list) {
|
if($bir_list) {
|
||||||
Log::info('生日有礼短信发送状态查询开始->' . json_encode($bir_list));
|
Log::info('生日有礼短信发送状态查询开始->' . json_encode($bir_list));
|
||||||
foreach ($bir_list as $k => $value) {
|
foreach ($bir_list as $k => $value) {
|
||||||
@@ -86,21 +86,22 @@ class QuerySmsStatus extends Command
|
|||||||
Log::info('营销短信发送状态查询开始->' . json_encode($bir_list));
|
Log::info('营销短信发送状态查询开始->' . json_encode($bir_list));
|
||||||
foreach ($bir_list as $k => $value) {
|
foreach ($bir_list as $k => $value) {
|
||||||
$data = [
|
$data = [
|
||||||
'PhoneNumber' => $value['user_phone'],
|
'bizId' => $value['biz_id'],
|
||||||
'BizId' => $value['biz_id'],
|
'phoneNumber' => $value['user_phone'],
|
||||||
'SendDate' => date('Ymd'),
|
'sendDate' => date('Ymd'),
|
||||||
'PageSize' => 1,
|
'pageSize' => 10,
|
||||||
'CurrentPage' => 20,
|
'currentPage' => 1,
|
||||||
];
|
];
|
||||||
|
Log::info('12312312312312' . json_encode($data));
|
||||||
$res = AlibabaSms::QuerySendDetails($data);
|
$res = AlibabaSms::QuerySendDetails($data);
|
||||||
try {
|
try {
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
if($res['Code'] == 'OK') {
|
if($res['Code'] == 'OK') {
|
||||||
$push_resp = $res['ErrCode'];
|
$push_resp = $res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['ErrCode'];
|
||||||
if($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 3) {
|
if($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 3) {
|
||||||
$push_status = 2;
|
$push_status = 2;
|
||||||
// 扣掉余额
|
// 扣掉余额
|
||||||
ShopInfo::moeny(config('cons.sms_price'), $value['main_shop_id'], 2, );
|
ShopInfo::moeny(config('cons.sms_price'), $value['main_shop_id'], 2);
|
||||||
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 2) {
|
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 2) {
|
||||||
$push_status = -1;
|
$push_status = -1;
|
||||||
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 1) {
|
}elseif ($res['SmsSendDetailDTOs']['SmsSendDetailDTO'][0]['SendStatus'] == 1) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if (!function_exists('curl_post')) {
|
|||||||
{
|
{
|
||||||
$postData = json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
$postData = json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||||
if(!empty($params['shopId'])) {
|
if(!empty($params['shopId'])) {
|
||||||
Log::write('耗材预警提交json' . $postData);
|
\support\Log::info('curl_post--->' . $postData);
|
||||||
}
|
}
|
||||||
$opts = array(
|
$opts = array(
|
||||||
CURLOPT_TIMEOUT => 30,
|
CURLOPT_TIMEOUT => 30,
|
||||||
@@ -120,6 +120,7 @@ if (!function_exists('curl_post')) {
|
|||||||
$responsedata = curl_exec($ch);
|
$responsedata = curl_exec($ch);
|
||||||
$error = curl_error($ch);
|
$error = curl_error($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
\support\Log::info('curl_post_结果--->' . $responsedata);
|
||||||
return $responsedata;
|
return $responsedata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,11 +160,8 @@ if (!function_exists('replace_json_keys')) {
|
|||||||
{
|
{
|
||||||
$originalData = json_decode($originalJson, true);
|
$originalData = json_decode($originalJson, true);
|
||||||
$mapData = json_decode($mapJson, true);
|
$mapData = json_decode($mapJson, true);
|
||||||
|
|
||||||
$reverseMap = array_flip($mapData);
|
$reverseMap = array_flip($mapData);
|
||||||
|
|
||||||
$newData = [];
|
$newData = [];
|
||||||
|
|
||||||
foreach ($originalData as $oldKey => $value) {
|
foreach ($originalData as $oldKey => $value) {
|
||||||
// 如果原始键在映射中存在,则替换为对应的新键;否则保留原键
|
// 如果原始键在映射中存在,则替换为对应的新键;否则保留原键
|
||||||
$newKey = $reverseMap[$oldKey] ?? $oldKey;
|
$newKey = $reverseMap[$oldKey] ?? $oldKey;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class AlibabaSms extends Model
|
|||||||
*/
|
*/
|
||||||
public static function main($args){
|
public static function main($args){
|
||||||
|
|
||||||
|
Log::info('最终发送短信--' . json_encode($args, 256));
|
||||||
$client = self::createClient();
|
$client = self::createClient();
|
||||||
$sendSmsRequest = new SendSmsRequest($args);
|
$sendSmsRequest = new SendSmsRequest($args);
|
||||||
$runtime = new RuntimeOptions([]);
|
$runtime = new RuntimeOptions([]);
|
||||||
@@ -68,6 +69,7 @@ class AlibabaSms extends Model
|
|||||||
// 申请新短信模版
|
// 申请新短信模版
|
||||||
public static function CreateSmsTemplate($data)
|
public static function CreateSmsTemplate($data)
|
||||||
{
|
{
|
||||||
|
Log::info('最终发送短信模版--' . json_encode($data, 256));
|
||||||
$client = self::createClient();
|
$client = self::createClient();
|
||||||
$createSmsTemplateRequest = new CreateSmsTemplateRequest($data);
|
$createSmsTemplateRequest = new CreateSmsTemplateRequest($data);
|
||||||
$runtime = new RuntimeOptions([]);
|
$runtime = new RuntimeOptions([]);
|
||||||
@@ -110,6 +112,8 @@ class AlibabaSms extends Model
|
|||||||
// 修改模版
|
// 修改模版
|
||||||
public static function UpdateSmsTemplate($data)
|
public static function UpdateSmsTemplate($data)
|
||||||
{
|
{
|
||||||
|
Log::info('最终修改发送短信模版--' . json_encode($data));
|
||||||
|
return true;
|
||||||
$client = self::createClient();
|
$client = self::createClient();
|
||||||
$updateSmsTemplateRequest = new UpdateSmsTemplateRequest($data);
|
$updateSmsTemplateRequest = new UpdateSmsTemplateRequest($data);
|
||||||
$runtime = new RuntimeOptions([]);
|
$runtime = new RuntimeOptions([]);
|
||||||
@@ -159,7 +163,7 @@ class AlibabaSms extends Model
|
|||||||
/**
|
/**
|
||||||
* 查询短信发送结果
|
* 查询短信发送结果
|
||||||
*/
|
*/
|
||||||
public function QuerySendDetails($data)
|
public static function QuerySendDetails($data)
|
||||||
{
|
{
|
||||||
$client = self::createClient();
|
$client = self::createClient();
|
||||||
$querySendDetailsRequest = new QuerySendDetailsRequest($data);
|
$querySendDetailsRequest = new QuerySendDetailsRequest($data);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class ShopInfo
|
|||||||
if($data_arr['data']['totalPage'] > 1) {
|
if($data_arr['data']['totalPage'] > 1) {
|
||||||
for ($i = 2; $i <= $data_arr['data']['totalPage']; $i++) {
|
for ($i = 2; $i <= $data_arr['data']['totalPage']; $i++) {
|
||||||
$data_arr = self::javaGetUserList($k_user_params, $i, $size);
|
$data_arr = self::javaGetUserList($k_user_params, $i, $size);
|
||||||
if($data_arr['code'] == 0) {
|
if($data_arr['code'] == 200) {
|
||||||
if(empty($for_user_list)) {
|
if(empty($for_user_list)) {
|
||||||
$for_user_list = self::evnuserlist($data_arr['data']['records']);
|
$for_user_list = self::evnuserlist($data_arr['data']['records']);
|
||||||
}else {
|
}else {
|
||||||
@@ -80,10 +80,10 @@ class ShopInfo
|
|||||||
}
|
}
|
||||||
$user_list = array_merge($user_list, $for_user_list);
|
$user_list = array_merge($user_list, $for_user_list);
|
||||||
}
|
}
|
||||||
|
return $user_list;
|
||||||
}else {
|
}else {
|
||||||
Log::info('获取用户列表时出错' . json_encode($data_arr));
|
Log::info('获取用户列表时出错' . json_encode($data_arr));
|
||||||
}
|
}
|
||||||
return $user_list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function evnuserlist($data)
|
public static function evnuserlist($data)
|
||||||
@@ -92,7 +92,7 @@ class ShopInfo
|
|||||||
$push_user[] = [
|
$push_user[] = [
|
||||||
'user_id' => $user['id'],
|
'user_id' => $user['id'],
|
||||||
'phone' => $user['phone'],
|
'phone' => $user['phone'],
|
||||||
'nick_name' => $user['nickName'],
|
'nick_name' => $user['nick_name'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return $push_user;
|
return $push_user;
|
||||||
@@ -103,25 +103,25 @@ class ShopInfo
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'用户昵称' => [
|
'用户昵称' => [
|
||||||
'username', '用户昵称'
|
'username', '用户昵称', 'user_nick'
|
||||||
],
|
],
|
||||||
'店铺名称' => [
|
'店铺名称' => [
|
||||||
'shopname', '店铺名称'
|
'shopname', '店铺名称', 'name'
|
||||||
],
|
],
|
||||||
'活动名称' => [
|
'活动名称' => [
|
||||||
'activityname', '活动名称',
|
'activityname', '活动名称', 'name'
|
||||||
],
|
],
|
||||||
'活动时间' => [
|
'活动时间' => [
|
||||||
'activitytime', '活动时间',
|
'activitytime', '活动时间', 'time'
|
||||||
],
|
],
|
||||||
'数量' => [
|
'数量' => [
|
||||||
'num', '数量',
|
'num', '数量', 'money'
|
||||||
],
|
],
|
||||||
'金额' => [
|
'金额' => [
|
||||||
'money', '金额',
|
'money', '金额', 'money'
|
||||||
],
|
],
|
||||||
'时间' => [
|
'时间' => [
|
||||||
'time', '时间',
|
'time', '时间', 'time',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -156,6 +156,38 @@ class ShopInfo
|
|||||||
return $new_arr;
|
return $new_arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function handleSmsTemplatesrule($content)
|
||||||
|
{
|
||||||
|
$arr = handldollerstr($content);
|
||||||
|
$x_arr = self::getTempDineList();
|
||||||
|
$new_arr = [];
|
||||||
|
$item_new_arr = [];
|
||||||
|
if($arr) {
|
||||||
|
$i = 1;
|
||||||
|
foreach ($arr as $k => $v) {
|
||||||
|
if(isset($x_arr[$v])) {
|
||||||
|
$k_str = $x_arr[$v][0];
|
||||||
|
$v_str = $x_arr[$v][2];
|
||||||
|
$new_arr[$k_str] = $v_str;
|
||||||
|
}else {
|
||||||
|
$item = 'item' . $i;
|
||||||
|
$item_new_arr[$item] = 'name';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($new_arr && $item_new_arr) {
|
||||||
|
$new_arr = array_merge($new_arr, $item_new_arr);
|
||||||
|
}
|
||||||
|
if(!$new_arr && $item_new_arr) {
|
||||||
|
$new_arr = $item_new_arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $new_arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 处理发送短信时短信模版替换内容
|
// 处理发送短信时短信模版替换内容
|
||||||
public static function handlesendSmsTemplates($content)
|
public static function handlesendSmsTemplates($content)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,17 +31,17 @@ class ApplySmsTemp implements Consumer
|
|||||||
if($temp) {
|
if($temp) {
|
||||||
// 处理替换内容
|
// 处理替换内容
|
||||||
$templateContent_arr = ShopInfo::handleSmsTemplates($temp['content']);
|
$templateContent_arr = ShopInfo::handleSmsTemplates($temp['content']);
|
||||||
$templateContent_json = json_encode($templateContent_arr);
|
$templateContent_json = json_encode(ShopInfo::handleSmsTemplatesrule($temp['content']), 256);
|
||||||
$content = replace_placeholder_keys($temp['content'], $templateContent_arr);
|
$content = replace_placeholder_keys($temp['content'], $templateContent_arr);
|
||||||
// 待申请
|
// 待申请
|
||||||
if($temp['status'] == 0) {
|
if($temp['status'] == 0) {
|
||||||
$data = [
|
$data = [
|
||||||
'TemplateName' => $temp['title'],
|
'templateName' => $temp['title'],
|
||||||
'TemplateContent' => $content,
|
'templateContent' => $content,
|
||||||
'TemplateRule' => $templateContent_json,
|
'templateRule' => $templateContent_json,
|
||||||
'Remark' => !empty($temp['scene_detail']) ? $temp['scene_detail'] : '',
|
'remark' => !empty($temp['scene_detail']) ? $temp['scene_detail'] : '',
|
||||||
'TemplateType' => 2,
|
'templateType' => 2,
|
||||||
'RelatedSignName' => config('cons.sms_sign'),
|
'relatedSignName' => config('cons.sms_sign'),
|
||||||
];
|
];
|
||||||
// 调用接口
|
// 调用接口
|
||||||
$res = AlibabaSms::CreateSmsTemplate($data);
|
$res = AlibabaSms::CreateSmsTemplate($data);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace app\queue\redis;
|
|||||||
|
|
||||||
use app\model\AlibabaSms;
|
use app\model\AlibabaSms;
|
||||||
use app\model\ShopInfo;
|
use app\model\ShopInfo;
|
||||||
|
use ba\Exception;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use support\think\Db;
|
use support\think\Db;
|
||||||
use Webman\RedisQueue\Consumer;
|
use Webman\RedisQueue\Consumer;
|
||||||
@@ -17,77 +18,103 @@ class SendMarkSms implements Consumer
|
|||||||
|
|
||||||
public function consume($data)
|
public function consume($data)
|
||||||
{
|
{
|
||||||
Log::info('消息队列【发送营销短信】接收到消息' . $data);
|
try {
|
||||||
if($data) {
|
Db::startTrans();
|
||||||
// 发送任务
|
Log::info('消息队列【发送营销短信】接收到消息' . $data);
|
||||||
$record = Db::table('sms_push_event')->where(['id' => $data, 'push_type' => 2])->find();
|
// 区分数据
|
||||||
if($record) {
|
$arr = explode(',', $data);
|
||||||
// 待发送
|
if(is_array($arr)) {
|
||||||
if($record['status'] == 0) {
|
$shop_id = $arr[0];
|
||||||
// 范围用户
|
$sms_push_event_id = $arr[1];
|
||||||
if($record['user_type'] == 2) {
|
}else {
|
||||||
$k_user_params = Db::table('sms_push_event_user')->where(['event_id' => $record['id']])->find();
|
Log::info('send.mark.sms数据格式错误');
|
||||||
if($k_user_params) {
|
return false;
|
||||||
$user_list = ShopInfo::getUserList($k_user_params);
|
}
|
||||||
}else {
|
if($data) {
|
||||||
Log::info('范围用户查找出错');
|
Log::info('$data');
|
||||||
return false;
|
// 发送任务
|
||||||
}
|
// $record = Db::table('sms_push_event')->where(['id' => $sms_push_event_id, 'push_type' => 2])->find();
|
||||||
}elseif ($record['status'] == 1) {
|
$record = Db::table('sms_push_event')->where(['id' => $sms_push_event_id])->find();
|
||||||
// 全部用户
|
if($record) {
|
||||||
$user_list = Db::table('tb_shop_user')->whereNotNull('phone')->select();
|
Log::info('$record');
|
||||||
$user_list = ShopInfo::evnuserlist($user_list);
|
// 待发送
|
||||||
}
|
if($record['status'] == 0) {
|
||||||
$y_temp = Db::table('sms_shop_template')->where(['id' => $record['push_event_id']])->find();
|
Log::info('待发送');
|
||||||
if($user_list && $y_temp) {
|
// 范围用户
|
||||||
foreach ($user_list as $k => $v) {
|
if($record['user_type'] == 2) {
|
||||||
// 检测余额
|
Log::info('范围用户');
|
||||||
$shop_money = Db::table('sms_shop_money')->where(['shop_id' => $record['shop_id']])->find();
|
$k_user_params = Db::table('sms_push_event_user')->where(['event_id' => $record['id']])->find();
|
||||||
if($shop_money) {
|
if($k_user_params) {
|
||||||
// 余额计算
|
$user_list = ShopInfo::getUserList($k_user_params);
|
||||||
if($shop_money['money'] > config('cons.sms_price')) {
|
if(!$user_list) {
|
||||||
$templateParam = replace_json_keys($record['json'], $y_temp['content_json']);
|
|
||||||
$data = [
|
|
||||||
'templateCode' => $y_temp['template_code'],
|
|
||||||
'templateParam' => $templateParam,
|
|
||||||
'phoneNumbers' => $user_list['phone'],
|
|
||||||
'signName' => config('cons.sms_sign'),
|
|
||||||
];
|
|
||||||
$res = AlibabaSms::main($data);
|
|
||||||
Db::table('sms_push_event')->where(['id' => $record['id']])->update([
|
|
||||||
'status' => '1',
|
|
||||||
'update_time' => date('Y-m-d H:i:s'),
|
|
||||||
'send_time' => date('Y-m-d H:i:s'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
if($res['Code'] == 'OK') {
|
|
||||||
Db::table('sms_push_event_record')->insert([
|
|
||||||
'shop_id' => $record['shop_id'],
|
|
||||||
'event_id' => $record['id'],
|
|
||||||
'user_id' => $v['user_id'],
|
|
||||||
'user_phone' => $v['phone'],
|
|
||||||
'biz_id' => $res['BizId'],
|
|
||||||
'send_time' => date('Y-m-d H:i:s'),
|
|
||||||
'create_time' => date('Y-m-d H:i:s'),
|
|
||||||
'status' => 1,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
Log::info('商户【' . $record['main_shop_id'] . '】余额不足');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
Log::info('商户【' . $record['main_shop_id'] . '】余额为空');
|
Log::info('范围用户查找出错');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}elseif ($record['user_type'] == 1) {
|
||||||
|
Log::info('全部用户');
|
||||||
|
// 全部用户
|
||||||
|
$user_list = Db::table('tb_shop_user')->whereNotNull('phone')->field('id,phone,nick_name')->select();
|
||||||
|
$user_list = ShopInfo::evnuserlist($user_list);
|
||||||
|
}
|
||||||
|
$y_temp = Db::table('sms_shop_template')->where(['id' => $record['push_event_id']])->find();
|
||||||
|
Log::info('用户列表' . json_encode($user_list));
|
||||||
|
if($user_list && $y_temp) {
|
||||||
|
foreach ($user_list as $k => $v) {
|
||||||
|
// 检测余额
|
||||||
|
$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')) {
|
||||||
|
$templateParam = replace_json_keys($record['json'], $y_temp['content_json'], $v);
|
||||||
|
$data = [
|
||||||
|
'templateCode' => $y_temp['template_code'],
|
||||||
|
'templateParam' => $templateParam,
|
||||||
|
'phoneNumbers' => $v['phone'],
|
||||||
|
'signName' => config('cons.sms_sign'),
|
||||||
|
];
|
||||||
|
$res = AlibabaSms::main($data);
|
||||||
|
Db::table('sms_push_event')->where(['id' => $record['id']])->update([
|
||||||
|
'status' => '1',
|
||||||
|
'update_time' => date('Y-m-d H:i:s'),
|
||||||
|
'send_time' => date('Y-m-d H:i:s'),
|
||||||
|
]);
|
||||||
|
if($res['Code'] == 'OK') {
|
||||||
|
Db::table('sms_push_event_record')->insert([
|
||||||
|
'shop_id' => $record['shop_id'],
|
||||||
|
'event_id' => $record['id'],
|
||||||
|
'user_id' => $v['user_id'],
|
||||||
|
'user_phone' => $v['phone'],
|
||||||
|
'biz_id' => $res['BizId'],
|
||||||
|
'send_time' => date('Y-m-d H:i:s'),
|
||||||
|
'create_time' => date('Y-m-d H:i:s'),
|
||||||
|
'status' => 1,
|
||||||
|
]);
|
||||||
|
Db::commit();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Log::info('商户【' . $record['shop_id'] . '】余额不足');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Log::info('商户【' . $record['shop_id'] . '】余额为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Log::info('【发送营销短信】无目标用户---》' . $record['user_id']);
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
Log::info('【发送营销短信】无目标用户---》' . $record['user_id']);
|
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
Log::info('发送营销短信未查询到');
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
Log::info('发送营销短信未查询到');
|
|
||||||
}
|
}
|
||||||
|
}catch (Exception $e) {
|
||||||
|
Log::error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user