|
@@ -49,13 +49,6 @@ class Chuyutimedtask extends Api
|
|
|
];
|
|
|
|
|
|
$res = Alisms::sendSmsCode($sendSmsRequest);
|
|
|
-// Array
|
|
|
-// (
|
|
|
-// [Message] => OK
|
|
|
-// [RequestId] => 912A52E8-8A46-52D1-9272-3A4B5A7B0DB2
|
|
|
-// [Code] => OK ===> 表示成功
|
|
|
-// [BizId] => 171320468216024553^0
|
|
|
-// )
|
|
|
|
|
|
// 短信发送记录
|
|
|
$smslog_model = new Smslog();
|
|
@@ -102,53 +95,49 @@ class Chuyutimedtask extends Api
|
|
|
$overtime = time() - $cancel_order_recovery * 3600;
|
|
|
|
|
|
$cancel_order_model = new Cannelorder();
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'timeout' => 1,
|
|
|
+ ];
|
|
|
+ $where['status'] = 1;
|
|
|
+ $where['timeout'] = 0;
|
|
|
+ $where['create_time'] = ['<=', $overtime];
|
|
|
+ $cancel_order_model->isUpdate(true, $where)->save($data);
|
|
|
+ $this->success('ok');
|
|
|
//状态:1=已接收,2=已清点,3=待退款,4=已退款,5=已入库--
|
|
|
- $cancel_order = $cancel_order_model->alias('o')
|
|
|
- ->join('user u', 'o.b_user_id = u.id')
|
|
|
- ->field('o.id,o.b_user_id,u.mobile')
|
|
|
- ->where('o.status', '=', 1)
|
|
|
- ->where('o.timeout', '=', 0)
|
|
|
- ->where('o.createtime', '<=', $overtime)->select();
|
|
|
-
|
|
|
- if (count($cancel_order) == 0) {
|
|
|
- $this->success('无数据');
|
|
|
- }
|
|
|
|
|
|
-// $mobiles = [];
|
|
|
+ // --需求更改不要短信了
|
|
|
+// $cancel_order = $cancel_order_model->alias('o')
|
|
|
+// ->join('user u', 'o.b_user_id = u.id')
|
|
|
+// ->field('o.id,o.b_user_id,u.mobile')
|
|
|
+// ->where('o.status', '=', 1)
|
|
|
+// ->where('o.timeout', '=', 0)
|
|
|
+// ->where('o.createtime', '<=', $overtime)->select();
|
|
|
+//
|
|
|
+// if (count($cancel_order) == 0) {
|
|
|
+// $this->success('无数据');
|
|
|
+// }
|
|
|
+// $TemplateCode = "SMS_250740130";
|
|
|
// $ids = [];
|
|
|
// foreach ($cancel_order as $k => $row) {
|
|
|
-// $mobiles[] = $row['mobile'];
|
|
|
+// $phoneNumber = $row['mobile'];
|
|
|
+// $code = "786324";
|
|
|
+// $TemplateParam = json_encode(['code' => $code]);
|
|
|
+// $is_success = $this->SmsTemplate($TemplateCode, $phoneNumber, $TemplateParam);
|
|
|
+//
|
|
|
+// if ($is_success) {
|
|
|
// $ids[] = $row['id'];
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (count($ids) > 0) {
|
|
|
+// $data = [
|
|
|
+// 'timeout' => 1,
|
|
|
+// ];
|
|
|
+// $where['id'] = ['in', $ids];
|
|
|
+// $cancel_order_model->isUpdate(true, $where)->save($data);
|
|
|
+//
|
|
|
+// $this->success(__('发送成功'));
|
|
|
// }
|
|
|
-// $msg = "店铺注销退货未取回";
|
|
|
-// $template = 1;
|
|
|
-// $ret = Smslib::notice($mobiles, $msg, $template);
|
|
|
-
|
|
|
-
|
|
|
- // todo 更改模板类型
|
|
|
- $TemplateCode = "SMS_250740130";
|
|
|
- $ids = [];
|
|
|
- foreach ($cancel_order as $k => $row) {
|
|
|
- $phoneNumber = $row['mobile'];
|
|
|
- $code = "786324";
|
|
|
- $TemplateParam = json_encode(['code' => $code]);
|
|
|
- $is_success = $this->SmsTemplate($TemplateCode, $phoneNumber, $TemplateParam);
|
|
|
-
|
|
|
- if ($is_success) {
|
|
|
- $ids[] = $row['id'];
|
|
|
- }
|
|
|
- // todo add else log
|
|
|
- }
|
|
|
-
|
|
|
- if (count($ids) > 0) {
|
|
|
- $data = [
|
|
|
- 'timeout' => 1,
|
|
|
- ];
|
|
|
- $where['id'] = ['in', $ids];
|
|
|
- $cancel_order_model->isUpdate(true, $where)->save($data);
|
|
|
-
|
|
|
- $this->success(__('发送成功'));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -179,7 +168,7 @@ class Chuyutimedtask extends Api
|
|
|
// }
|
|
|
|
|
|
|
|
|
- $TemplateCode = "SMS_250740130";
|
|
|
+ $TemplateCode = "SMS_262525727";
|
|
|
foreach ($recovery_bill as $k => $row) {
|
|
|
$phoneNumber = $row['mobile'];
|
|
|
$code = "786324";
|