Kaynağa Gözat

预约商家短信

zhangxiaobin 1 yıl önce
ebeveyn
işleme
ae1ac6a1d7

+ 6 - 0
application/api/controller/PreOrder.php

@@ -129,6 +129,12 @@ class PreOrder extends Api
                     'pre_time'   => $preTime,//预约时间
                 ];
                 $service->preOrderToUser($params);
+                $smsService = new SmsService();
+                $smsParams = [
+                    'id' => $id,//ID
+                    'company_id' => $companyId,//门店ID
+                ];
+                $smsService->preOrderToShop($smsParams);
             } else {
                 $data['updatetime'] = $time;
                 $where['id'] = $id;

+ 3 - 4
application/common/service/SmsService.php

@@ -137,15 +137,14 @@ class SmsService
                 $preOrderWhere['id'] = $preOrderId;
                 $preOrder = model('PreOrder')->where($preOrderWhere)->find();
                 $name = isset($preOrder['name']) ? $preOrder['name'] : '';
-                $orderNo = isset($preOrder['pre_order_no']) ? $preOrder['pre_order_no'] : '';
-                $preTime = !empty($preOrder['pre_time']) ? date('Y-m-d H:i:s',$preOrder['pre_time']) : '';
+                $carNo = isset($preOrder['car_number']) ? $preOrder['car_number'] : '';
+                //您的门店有新的预约订单,预约用户:${name},车牌号:${chepai}。请及时到店处理!
                 $params = [
                     'template'    => $template,//短息模版
                     'mobile'      => $mobile,  //手机号
                     'data_params' => [
                         'name'    => $name,     //联系人
-                        'order_no' => $orderNo, //单号
-                        'time'    => date('Y-m-d H:i:s',$preTime),//预约时间
+                        'chepai' => $carNo,   //车牌
                     ],//短信参数
                 ];
                 $smsRes = $this->send($params);

+ 1 - 1
application/config.php

@@ -334,6 +334,6 @@ return [
     'ali_sms_template' => [
         'pro_order_u'    => 'SMS_461410697', //用户预约通知
         'service_expire' => 'SMS_461325805', //保养到期提醒用户
-        'order_to_c'     => '', //预约和购买套餐通知商家
+        'order_to_c'     => 'SMS_461320752', //预约和购买套餐通知商家
     ],
 ];