Commit 3bf2333cadfdd77b27165a07a558808d5072eecb
1 parent
105a86d5
Exists in
master
1.添加短信提示“提取码”。
Showing
7 changed files
with
33 additions
and
553 deletions
Show diff stats
app-wx/modules/check/controllers/DefaultController.php
... | ... | @@ -2,9 +2,9 @@ |
2 | 2 | |
3 | 3 | namespace app\wx\modules\check\controllers; |
4 | 4 | |
5 | +use Yii; | |
5 | 6 | use common\helpers\ImageManager; |
6 | 7 | use common\helpers\WxHelper; |
7 | -use Yii; | |
8 | 8 | use domain\smart\ScanRecords; |
9 | 9 | use domain\smart\SellerInputRecordRepository; |
10 | 10 | use stdClass; |
... | ... | @@ -15,7 +15,7 @@ use stdClass; |
15 | 15 | class DefaultController extends BaseController |
16 | 16 | { |
17 | 17 | /** |
18 | - * 校验 | |
18 | + * 校验首页 | |
19 | 19 | */ |
20 | 20 | public function actionIndex() |
21 | 21 | { |
... | ... | @@ -23,7 +23,7 @@ class DefaultController extends BaseController |
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * 查询是否激活 | |
26 | + * 查询是否激活 -(对应首页扫码验证接口) | |
27 | 27 | * @return string |
28 | 28 | */ |
29 | 29 | public function actionCheckActive() |
... | ... | @@ -57,7 +57,7 @@ class DefaultController extends BaseController |
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * 检查是否激活 | |
60 | + * 上传照片检查商品二维码真伪 -(对应提交图片校验submit-controller.js中的提交接口) | |
61 | 61 | * @return string |
62 | 62 | */ |
63 | 63 | public function actionCheckActived() |
... | ... | @@ -89,7 +89,7 @@ class DefaultController extends BaseController |
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | - * 上传微信图片 | |
92 | + * 上传微信JSAPI提交的校验图片 -(对应submit-controller.js页面图片上传接口) | |
93 | 93 | * @return string |
94 | 94 | */ |
95 | 95 | public function actionUpdateServiceid() |
... | ... | @@ -123,6 +123,7 @@ class DefaultController extends BaseController |
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
126 | + * 保存微信图片到远程服务器 | |
126 | 127 | * @param $wechat 微信基础类 |
127 | 128 | * @param string $tr 微信公众号的 media_id |
128 | 129 | * @return bool|string 返回保存到数据库里面的文件名称是的带URL的,同时会把图片传到阿里云的图片服务器上面 |
... | ... | @@ -163,7 +164,7 @@ class DefaultController extends BaseController |
163 | 164 | } |
164 | 165 | |
165 | 166 | /** |
166 | - * 获取消息 | |
167 | + * 获取消息 - (success-controller.js 中校验用到,info-controller.js 查询用到) | |
167 | 168 | * @return string |
168 | 169 | */ |
169 | 170 | public function actionGetInfo() | ... | ... |
app-wx/modules/smart/controllers/DefaultController.php
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | namespace app\wx\modules\smart\controllers; |
4 | 4 | |
5 | 5 | use Yii; |
6 | +use common\exts\sms\SmsManager; | |
6 | 7 | use common\helpers\CheckActiveHelper; |
7 | 8 | use common\helpers\ImageManager; |
8 | 9 | use common\helpers\ImageUtils; |
... | ... | @@ -76,7 +77,7 @@ class DefaultController extends BaseController |
76 | 77 | } |
77 | 78 | |
78 | 79 | /** |
79 | - * 提交激活 | |
80 | + * 提交激活 - (enter-controller.js提交激活页面用到) | |
80 | 81 | */ |
81 | 82 | public function actionSubmit() |
82 | 83 | { |
... | ... | @@ -143,7 +144,7 @@ class DefaultController extends BaseController |
143 | 144 | } else { |
144 | 145 | $productImagePath = $newPath; |
145 | 146 | } |
146 | - | |
147 | + $getCode = rand(10000, 99999); | |
147 | 148 | $saveData = [ |
148 | 149 | "user_mp_id" => $userId, |
149 | 150 | "leave_message" => $content, |
... | ... | @@ -151,11 +152,15 @@ class DefaultController extends BaseController |
151 | 152 | "product_image_path" => $productImagePath, |
152 | 153 | "product_vedio_path" => $productVedioPath, |
153 | 154 | "buyer_mobile" => $phone, |
154 | - "extraction_code" => rand(10000, 99999), | |
155 | + "extraction_code" => $getCode, | |
155 | 156 | "uuid" => $uuid |
156 | 157 | ]; |
157 | 158 | $result = SellerInputRecord::create($saveData); |
158 | 159 | if ($result) { |
160 | + try { | |
161 | + $sms = Yii::$app->sms; | |
162 | + $sms->sendGetCode($phone, $getCode); | |
163 | + } catch (\Exception $e) { } | |
159 | 164 | $e->success = true; |
160 | 165 | $e->msg = '激活成功!'; |
161 | 166 | } else { | ... | ... |
app-wx/modules/smart/views/default/pages/enter-template.php
... | ... | @@ -42,9 +42,9 @@ $baseUrl = Url::base(true); |
42 | 42 | </div> |
43 | 43 | <div class="space-line"></div> |
44 | 44 | <div class="input-item-cls" style="display:grid;flex-direction: row"> |
45 | - <label class="pub-title">买家手机号<span class="require-cls">(用于接收“提取码”短信)</span></label> | |
45 | + <label class="pub-title">手机号<span class="require-cls">(用于接收“提取码”短信)</span></label> | |
46 | 46 | <div class="input-box-cls"> |
47 | - <input class="input-cls phone-number" type="number" placeholder="请输入买家手机号" maxlength="11"/> | |
47 | + <input class="input-cls phone-number" type="number" placeholder="请输入手机号" maxlength="11"/> | |
48 | 48 | </div> |
49 | 49 | </div> |
50 | 50 | </div> | ... | ... |
app-wx/web/src/js/smart/enter-controller.js
... | ... | @@ -128,7 +128,7 @@ define( |
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | if (!utils.isMobile(phoneNumber)) { |
131 | - utils.toast({content:'请填写手机号码', closeDelay:3000}); | |
131 | + utils.toast({content:'请填写正确手机号码', closeDelay:3000}); | |
132 | 132 | $$(".phone-number").focus(); |
133 | 133 | return false; |
134 | 134 | } | ... | ... |
common/config/main.php
... | ... | @@ -6,5 +6,11 @@ return [ |
6 | 6 | 'cache' => [ |
7 | 7 | 'class' => 'yii\caching\FileCache', |
8 | 8 | ], |
9 | + 'sms'=>[ | |
10 | + 'class'=>'common\exts\sms\SmsManager', | |
11 | + 'smsKey'=>'LTAI4Fs7QiKCF4ZpZmEGFkcD', | |
12 | + 'smsSecret'=>'iVs6oI0KknlR2PrRhvQl6f4Xwsudlf', | |
13 | + 'smsSignName'=>'周合立科技', | |
14 | + ], | |
9 | 15 | ], |
10 | 16 | ]; |
11 | 17 | \ No newline at end of file | ... | ... |
common/exts/sms/SmsManager.php
... | ... | @@ -64,85 +64,13 @@ class SmsManager extends Component |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * 绑定手机号成功, 推送极办公业务介绍短信(已作废) | |
68 | - * 模版内容: 办公设备极速报修平台。 新用户享50元优惠券!修完抢最高50元红包。提供打印机、复印机、电脑维修服务!-回复T退订 | |
69 | - * 申请说明: 给用户发送认证成功后消息 | |
67 | + * 激活后给用户发送提取码 | |
68 | + * 模版内容: 模版CODE: SMS_180755775 | |
69 | + * 模版内容: 尊敬的用户,您的提取码为:${code},请勿泄漏于他人! | |
70 | 70 | * @param $phone |
71 | 71 | * @return mixed |
72 | 72 | */ |
73 | - public function sendBindPhoneSuccessMsg($phone) | |
74 | - { | |
75 | - $this->req->setSmsType("normal"); | |
76 | - $this->req->setRecNum($phone); | |
77 | - $this->req->setSmsTemplateCode("SMS_131430002"); | |
78 | - $result = $this->aliSms->execute($this->req); | |
79 | - return $result; | |
80 | - } | |
81 | - | |
82 | - /** | |
83 | - * 补发首单有礼优惠券短信(已废弃) | |
84 | - * 模版内容: 打印机、复印机维修,换耗材,“极办公”给您派新年利是!100元优惠券,首次报修可全额抵扣,请到#极办公小程序#个人中心查看。-回复T退订 | |
85 | - * 申请说明: 回馈极办公老客户,派发维修费代金券 | |
86 | - * @param $phone | |
87 | - * @return mixed | |
88 | - */ | |
89 | - public function reSendBindPhoneCouponMsg($phone) | |
90 | - { | |
91 | - $this->req->setSmsType("normal"); | |
92 | - $this->req->setRecNum($phone); | |
93 | - $this->req->setSmsTemplateCode("SMS_118725110"); | |
94 | - $result = $this->aliSms->execute($this->req); | |
95 | - return $result; | |
96 | - } | |
97 | - | |
98 | - /** | |
99 | - * 发送订单质保申请通知 | |
100 | - * 模版内容: 收到客户质保申请,请${contactHour}小时内致电客户,${finishHour}小时内处理完毕。逾期未处理账号将无法接单。若故障未解决,可能会扣除您该笔订单的维修费用。 | |
101 | - * 申请说明: 当有用户维修订单出现质保问题时发送给工程师,提醒工程师及时处理质保问题 | |
102 | - * @param $phone 手机号 | |
103 | - * @param $contactHour 多少小时内联系客户 | |
104 | - * @param $finishHour 多少小时内处理完毕 | |
105 | - * @return mixed | |
106 | - */ | |
107 | - public function sendWarrantyApplyMsg($phone, $contactHour, $finishHour) | |
108 | - { | |
109 | - $this->req->setSmsType("normal"); | |
110 | - $this->req->setSmsParam("{contactHour:" . $contactHour . ", finishHour:" . $finishHour . "}"); | |
111 | - $this->req->setRecNum($phone); | |
112 | - $this->req->setSmsTemplateCode("SMS_150170068"); // SMS_147200443 | |
113 | - $result = $this->aliSms->execute($this->req); | |
114 | - return $result; | |
115 | - } | |
116 | - | |
117 | - | |
118 | - /** | |
119 | - * 新订单 | |
120 | - * 模版内容: 您收到一个“${device}”的平台订单,马上打开极窝订单宝微信公众号查看吧~ | |
121 | - * 申请说明: 用于通知工程师收到新的平台订单 | |
122 | - * @param $phone | |
123 | - * @return mixed | |
124 | - */ | |
125 | - public function sendNewOrderMsg($phone, $device) | |
126 | - { | |
127 | - $this->req->setSmsType("normal"); | |
128 | - $this->req->setRecNum($phone); | |
129 | - | |
130 | - $params = json_encode(['device' => (string)$device]); | |
131 | - $this->req->setSmsParam($params); | |
132 | - | |
133 | - $this->req->setSmsTemplateCode("SMS_173479889"); | |
134 | - $result = $this->aliSms->execute($this->req); | |
135 | - return $result; | |
136 | - } | |
137 | - | |
138 | - /** | |
139 | - * 系统关闭订单通知 | |
140 | - * 模版内容: 您的“${device}”订单暂无工程师接单已经关闭,建议您换个时间再次提交报修。 | |
141 | - * 申请说明: 关闭短信,通知用户 | |
142 | - * @param $phone | |
143 | - * @return mixed | |
144 | - */ | |
145 | - public function sendCloseOrderMsg($phone, $device, $signName = '') | |
73 | + public function sendGetCode($phone, $code, $signName = '') | |
146 | 74 | { |
147 | 75 | // 设置短信签名 |
148 | 76 | if (!empty($signName)) { |
... | ... | @@ -150,440 +78,10 @@ class SmsManager extends Component |
150 | 78 | } |
151 | 79 | |
152 | 80 | $this->req->setSmsType("normal"); |
81 | + $this->req->setSmsParam("{\"code\":\"".$code."\"}"); | |
153 | 82 | $this->req->setRecNum($phone); |
154 | - | |
155 | - $params = json_encode(['device' => (string)$device]); | |
156 | - $this->req->setSmsParam($params); | |
157 | - | |
158 | - $this->req->setSmsTemplateCode("SMS_149417787"); // SMS_125810114 | |
159 | - $result = $this->aliSms->execute($this->req); | |
160 | - return $result; | |
161 | - } | |
162 | - | |
163 | - /** | |
164 | - * 设备绑定成功(目前未启用) | |
165 | - * 模版内容: 您绑定的用户设备“${device}”已审核通过,马上打开极办公微信公众号查看吧! | |
166 | - * 申请说明: 提醒 工程师设备绑定申请已经成功 | |
167 | - * @return mixed | |
168 | - */ | |
169 | - public function sendBindDeviceSuccessMsg($phone,$device) | |
170 | - { | |
171 | - $this->req->setSmsType("normal"); | |
172 | - $this->req->setSmsParam("{\"device\":\"".$device."\"}"); | |
173 | - $this->req->setRecNum($phone); | |
174 | - $this->req->setSmsTemplateCode("SMS_65935276"); | |
175 | - $result = $this->aliSms->execute($this->req); | |
176 | - return $result; | |
177 | - } | |
178 | - | |
179 | - /** | |
180 | - * 设备绑定失败(目前未启用) | |
181 | - * 模版内容: 您绑定的用户设备“${device}”审核不通过,请打开极办公微信公众号查看原因! | |
182 | - * 申请说明: 设备绑定失败的时候通知工程师 | |
183 | - * @param $phone | |
184 | - * @return mixed | |
185 | - */ | |
186 | - public function sendBindDeviceFailMsg($phone,$device) | |
187 | - { | |
188 | - $this->req->setSmsType("normal"); | |
189 | - $this->req->setSmsParam("{\"device\":\"".$device."\"}"); | |
190 | - $this->req->setRecNum($phone); | |
191 | - $this->req->setSmsTemplateCode("SMS_65925271"); | |
192 | - $result = $this->aliSms->execute($this->req); | |
193 | - return $result; | |
194 | - } | |
195 | - | |
196 | - /** | |
197 | - * 技能认证成功通知 | |
198 | - * 模版内容: 恭喜您通过“${skill}”技能认证。极办公工程师公众号接单,收入约40元-100元/单,新工程师完成的前10单补贴10元/单。SMS_149422688 | |
199 | - * 模版内容: 恭喜您通过“${skill}”技能认证。极办公工程师公众号接单,收入约40元-100元/单 SMS_155570179 | |
200 | - * 模版内容: 恭喜您通过“${skill}”技能认证。接下来能接到更多订单了。SMS_173341678 | |
201 | - * 申请说明: 工程师技能认证通过推送消息 | |
202 | - */ | |
203 | - public function sendSkillAuthSuccessMsg($phone, $skill, $freeCommissionCount) | |
204 | - { | |
205 | - if ($freeCommissionCount > 0) { | |
206 | - // 恭喜您通过“${skill}”技能认证。极办公工程师公众号接单,收入约50元-200元/单,前${count}单不抽佣,佣金全额返还。 | |
207 | - $param = "{skill:" . $skill . "}"; | |
208 | - $templateCode = "SMS_173341678"; | |
209 | - } else { | |
210 | - // 恭喜您通过“${skill}”技能认证。极办公工程师公众号接单,收入约50元-200元/单。 | |
211 | - $param = "{skill:" . $skill . "}"; | |
212 | - $templateCode = "SMS_173341678"; | |
213 | - } | |
214 | - | |
215 | - $this->req->setSmsType("normal"); | |
216 | - $this->req->setSmsParam($param); | |
217 | - $this->req->setRecNum($phone); | |
218 | - $this->req->setSmsTemplateCode($templateCode); | |
219 | - $result = $this->aliSms->execute($this->req); | |
220 | - return $result; | |
221 | - } | |
222 | - | |
223 | - /** | |
224 | - * 技能认证考试失败(已废弃) | |
225 | - * 模版内容: 您的“${skill}”技能认证审核不通过!请打开极办公微信公众号查看原因! | |
226 | - * 申请说明: 工程师技能认证失败通知 | |
227 | - */ | |
228 | - public function sendSkillAuthFailMsg($phone,$skill) | |
229 | - { | |
230 | - $this->req->setSmsType("normal"); | |
231 | - $this->req->setSmsParam("{\"skill\":\"".$skill."\"}"); | |
232 | - $this->req->setRecNum($phone); | |
233 | - $this->req->setSmsTemplateCode("SMS_66020229"); | |
234 | - $result = $this->aliSms->execute($this->req); | |
235 | - return $result; | |
236 | - } | |
237 | - | |
238 | - /** | |
239 | - * 实名认证成功 | |
240 | - * 模版内容: 恭喜您成功通过实名认证!请打开极办公微信公众号继续完成技能认证! | |
241 | - * 申请说明: 工程师实名认证成功后通知工程师 | |
242 | - * @param $phone | |
243 | - * @return mixed | |
244 | - */ | |
245 | - public function sendUserAuthSuccessMsg($phone) | |
246 | - { | |
247 | - $this->req->setSmsType("normal"); | |
248 | - $this->req->setRecNum($phone); | |
249 | - $this->req->setSmsTemplateCode("SMS_66070260"); | |
250 | - $result = $this->aliSms->execute($this->req); | |
251 | - return $result; | |
252 | - } | |
253 | - | |
254 | - /** | |
255 | - * 实名认证失败 | |
256 | - * 模版内容: 您的实名认证审核不通过!请打开极办公微信公众号查看原因! | |
257 | - * 申请说明: 工程师实名认证失败的时候通知工程师 | |
258 | - * @param $phone | |
259 | - * @return mixed | |
260 | - */ | |
261 | - public function sendUserAuthFailMsg($phone) | |
262 | - { | |
263 | - $this->req->setSmsType("normal"); | |
264 | - $this->req->setRecNum($phone); | |
265 | - $this->req->setSmsTemplateCode("SMS_66005216"); | |
266 | - $result = $this->aliSms->execute($this->req); | |
267 | - return $result; | |
268 | - } | |
269 | - | |
270 | - /** | |
271 | - * 余额不足提醒(已废弃) | |
272 | - * 模版内容: 微信商户平台${appid}余额不足,请及时充值! | |
273 | - * 申请说明: 用户提现的时候,发现余额不足,提醒管理员 | |
274 | - */ | |
275 | - public function sendNoMoneyNotice($phone, $appid) | |
276 | - { | |
277 | - $this->req->setSmsType("normal"); | |
278 | - $this->req->setSmsParam("{\"appid\":\"".$appid."\"}"); | |
279 | - $this->req->setRecNum($phone); | |
280 | - $this->req->setSmsTemplateCode("SMS_76950035"); | |
281 | - $result = $this->aliSms->execute($this->req); | |
282 | - return $result; | |
283 | - } | |
284 | - | |
285 | - /** | |
286 | - * 微信商户号余额不足提醒 | |
287 | - * 模版内容: 微信商户号${mch_id}当前余额${balance}元,低于${warning_balance}元,请及时充值! | |
288 | - * 申请说明: 用户提现的时候,发现微信商户号余额不足,提醒管理员 | |
289 | - */ | |
290 | - public function sendNoMoneyWarning($phone, $mchId, $balance, $warningBalance) | |
291 | - { | |
292 | - $this->req->setSmsType("normal"); | |
293 | - $this->req->setSmsParam("{mch_id:" . $mchId . ", balance:" . $balance . ", warning_balance:" . $warningBalance . "}"); | |
294 | - $this->req->setRecNum($phone); | |
295 | - $this->req->setSmsTemplateCode("SMS_140731639"); | |
296 | - $result = $this->aliSms->execute($this->req); | |
297 | - | |
298 | - return $result; | |
299 | - } | |
300 | - | |
301 | - /** | |
302 | - * 发票已经发送提醒 | |
303 | - * 模版内容: 您于${date}申请的电子票已发送,您可前往“极办公小程序”个人中心或者登录您的邮箱,查看电子票信息,感谢您的使用! | |
304 | - * 申请说明: 用于通知客户已经发送开具的电子票到指定邮箱 | |
305 | - */ | |
306 | - public function sendInvoiceNotice($phone, $date, $signName = SmsMessage::SIGN_NAME_JIWORK) | |
307 | - { | |
308 | - $this->req->setSmsFreeSignName($signName); | |
309 | - $this->req->setSmsType("normal"); | |
310 | - $this->req->setSmsParam("{\"date\":\"".$date."\"}"); | |
311 | - $this->req->setRecNum($phone); | |
312 | - $this->req->setSmsTemplateCode("SMS_149417844"); | |
313 | - $result = $this->aliSms->execute($this->req); | |
314 | - | |
315 | - return $result; | |
316 | - } | |
317 | - | |
318 | - /** | |
319 | - * 通过技能实操考核(已废弃) | |
320 | - * 模版内容: 恭喜您通过“${skill}”技能的实操考核!请打开极办公工程师微信公众号开始接单吧~ | |
321 | - * 申请说明: 通过技能实操考核短信提醒 | |
322 | - */ | |
323 | - public function sendSkillPracticeSuccessMsg($phone, $skill) | |
324 | - { | |
325 | - $this->req->setSmsType("normal"); | |
326 | - $this->req->setSmsParam("{\"skill\":\"".$skill."\"}"); | |
327 | - $this->req->setRecNum($phone); | |
328 | - $this->req->setSmsTemplateCode("SMS_128455012"); | |
329 | - $result = $this->aliSms->execute($this->req); | |
330 | - | |
331 | - return $result; | |
332 | - } | |
333 | - | |
334 | - /** | |
335 | - * 微信支付接口告警 | |
336 | - * 模版内容: 微信支付接口告警(${client_name}) 错误描述: ${errorMsg},请及时处理! | |
337 | - * 申请说明: 当平台调用微信支付接口返回错误时需及时通知平台管理员。 | |
338 | - * 示例:微信支付接口告警(微信小程序) 错误描述:NOTENOUGH=>商户后台余额不足,请及时处理! | |
339 | - */ | |
340 | - public function sendWechatPayNotice($phone, $clientName, $errorMsg) | |
341 | - { | |
342 | - $this->req->setSmsType("normal"); | |
343 | - $this->req->setSmsParam("{client_name:" . $clientName . ", errorMsg:" . $errorMsg . "}"); | |
344 | - $this->req->setRecNum($phone); | |
345 | - $this->req->setSmsTemplateCode("SMS_128595001"); | |
346 | - $result = $this->aliSms->execute($this->req); | |
347 | - | |
348 | - return $result; | |
349 | - } | |
350 | - | |
351 | - /** 封号短信(已废弃) | |
352 | - * 模版内容: 您的账号因为${reason}被系统封号,如有疑问请联系极办公客服 | |
353 | - * 申请说明: 工程师封号 | |
354 | - * @param $phone | |
355 | - * @param $reason | |
356 | - * @return mixed | |
357 | - */ | |
358 | - public function sendBlockEngineerMsg($phone, $reason) | |
359 | - { | |
360 | - $this->req->setSmsType("normal"); | |
361 | - $this->req->setSmsParam('{"reason":"' . $reason . '"}'); | |
362 | - $this->req->setRecNum($phone); | |
363 | - $this->req->setSmsTemplateCode("SMS_135345116"); | |
364 | - $result = $this->aliSms->execute($this->req); | |
365 | - | |
366 | - return $result; | |
367 | - } | |
368 | - | |
369 | - /** 解封短信 | |
370 | - * 模版内容: 您的账号已经解封,未来请严格按照平台规则接单。 | |
371 | - * 申请说明: 解封工程师账号 | |
372 | - * @param $phone | |
373 | - * @return mixed | |
374 | - */ | |
375 | - public function sendUnblockEngineerMsg($phone) | |
376 | - { | |
377 | - $this->req->setSmsType("normal"); | |
378 | - $this->req->setRecNum($phone); | |
379 | - $this->req->setSmsTemplateCode("SMS_149417910"); // SMS_135355121 | |
380 | - $result = $this->aliSms->execute($this->req); | |
381 | - | |
382 | - return $result; | |
383 | - } | |
384 | - | |
385 | - /** 【客服】48小时质保申请延期通知 | |
386 | - * 模版内容: 收到一条客户质保申请,来自订单号(${orderno}),已超过48小时,请提醒工程师处理。 | |
387 | - * 申请说明: 客服订单质保通知 | |
388 | - * @param $phone | |
389 | - * @param $orderno | |
390 | - * @return mixed | |
391 | - */ | |
392 | - public function sendCustomServiceWarrantyDelayMsg($phone, $orderno) | |
393 | - { | |
394 | - $this->req->setSmsType("normal"); | |
395 | - $this->req->setSmsParam('{"orderno":"' . $orderno . '"}'); | |
396 | - $this->req->setRecNum($phone); | |
397 | - $this->req->setSmsTemplateCode("SMS_149422796"); // SMS_147195475 | |
398 | - $result = $this->aliSms->execute($this->req); | |
399 | - return $result; | |
400 | - } | |
401 | - | |
402 | - /**【客服】工程师频繁质保通知 | |
403 | - * 模版内容: 工程师${engineer}一个月内被客户申请质保达到${times}次,已被系统禁用${days}天,请重新安排技能实操考核。 | |
404 | - * 申请说明: 工程师服务质量太差,频繁被申请质保通知客服处理 | |
405 | - * @param $phone | |
406 | - * @param $engineer | |
407 | - * @param $times | |
408 | - * @param $days | |
409 | - * @return mixed | |
410 | - */ | |
411 | - public function sendCustomServiceFreqWarrantyMsg($phone, $engineer, $times, $days) | |
412 | - { | |
413 | - $this->req->setSmsType("normal"); | |
414 | - $this->req->setSmsParam("{engineer:" . $engineer . ", times:" . $times . ", days:" . $days . "}"); | |
415 | - $this->req->setRecNum($phone); | |
416 | - $this->req->setSmsTemplateCode("SMS_150180079"); | |
417 | - $result = $this->aliSms->execute($this->req); | |
418 | - return $result; | |
419 | - } | |
420 | - | |
421 | - /** | |
422 | - * 工程师接单成功短信模板 | |
423 | - * 模版内容: 您的“${device}”维修订单已经被${engineer}接单,稍后工程师会与您电话联系。为保护客户隐私,我们的来电为虚拟电话。进入“极办公”公众号查看订单进度 | |
424 | - * 申请说明: 工程师接单成功短信提醒 | |
425 | - */ | |
426 | - public function sendPickOrderNotice($phone, $device, $engineer, $signName = '') | |
427 | - { | |
428 | - // 设置短信签名 | |
429 | - if (!empty($signName)) { | |
430 | - $this->req->setSmsFreeSignName($signName); | |
431 | - } | |
432 | - | |
433 | - $this->req->setSmsType("normal"); | |
434 | - $this->req->setSmsParam("{device:" . $device . ", engineer:" . $engineer . "}"); | |
435 | - $this->req->setRecNum($phone); | |
436 | - $this->req->setSmsTemplateCode("SMS_178980160"); | |
437 | - $result = $this->aliSms->execute($this->req); | |
438 | - return $result; | |
439 | - } | |
440 | - | |
441 | - /** | |
442 | - * 工程师取消订单短信 | |
443 | - * 模版内容: 您的“${device}”维修订单,已被${engineer}取消,取消原因:${reason}。再下个订单吧,让其它工程师为您服务。 | |
444 | - * 申请说明: 工程师取消订单短信通知 | |
445 | - */ | |
446 | - public function sendEngineerCancelOrderNotice($phone, $device, $engineer, $reason, $signName = '') | |
447 | - { | |
448 | - // 设置短信签名 | |
449 | - if (!empty($signName)) { | |
450 | - $this->req->setSmsFreeSignName($signName); | |
451 | - } | |
452 | - | |
453 | - $this->req->setSmsType("normal"); | |
454 | - $this->req->setSmsParam("{device:" . $device . ", engineer:" . $engineer . ", reason:" . $reason . "}"); | |
455 | - $this->req->setRecNum($phone); | |
456 | - $this->req->setSmsTemplateCode("SMS_149422817"); // SMS_140731732 | |
457 | - $result = $this->aliSms->execute($this->req); | |
458 | - return $result; | |
459 | - } | |
460 | - | |
461 | - /** | |
462 | - * 用户新年利是短信 | |
463 | - * 模版内容: 打印机电脑报修平台,感谢老客户。微信搜索关注“极办公”公众号,领取猪年开工利是,${expire_hour}小时内有效。 | |
464 | - * 申请说明: 用户新年利是短信 | |
465 | - */ | |
466 | - public function sendUserNewYearRedPackNotice($phone, $expire_hour = 24) | |
467 | - { | |
468 | - $this->req->setSmsType("normal"); | |
469 | - $this->req->setSmsParam("{expire_hour:" . (int)$expire_hour . "}"); | |
470 | - $this->req->setRecNum($phone); | |
471 | - $this->req->setSmsTemplateCode("SMS_156470575"); // SMS_156470575 | |
472 | - $result = $this->aliSms->execute($this->req); | |
473 | - return $result; | |
474 | - } | |
475 | - | |
476 | - /** | |
477 | - * 模版名称: 用户新年利是(新) | |
478 | - * 模版CODE: SMS_157284328 | |
479 | - * 模版内容: 打印机电脑报修平台,感谢老客户。微信搜索关注“极办公”公众号,输入暗号${order}, 领取猪年开工利是,${expire_hour}小时内有效。 | |
480 | - */ | |
481 | - public function sendUserNewYearRedPackNoticeHasOrder($phone, $expire_hour = 24, $order_word = "") | |
482 | - { | |
483 | - $this->req->setSmsType("normal"); | |
484 | - $this->req->setSmsParam("{expire_hour:" . (int)$expire_hour . ", order:" . $order_word . "}"); | |
485 | - $this->req->setRecNum($phone); | |
486 | - $this->req->setSmsTemplateCode("SMS_157284328"); // SMS_156470575 | |
487 | - $result = $this->aliSms->execute($this->req); | |
488 | - return $result; | |
489 | - } | |
490 | - | |
491 | - /** | |
492 | - * 您下的***机器的维修订单暂无工程师接单,如需急用,可增加感谢费加快接单速度 | |
493 | - * @param $phone | |
494 | - * @param int $expire_hour | |
495 | - * @return mixed | |
496 | - */ | |
497 | - public function sendThankFeeNotice($phone, $deviceName, $signName = '') | |
498 | - { | |
499 | - // 设置短信签名 | |
500 | - if (!empty($signName)) { | |
501 | - $this->req->setSmsFreeSignName($signName); | |
502 | - } | |
503 | - | |
504 | - $this->req->setSmsType("normal"); | |
505 | - $this->req->setRecNum($phone); | |
506 | - $this->req->setSmsParam("{device_name:" . $deviceName . "}"); | |
507 | - $this->req->setSmsTemplateCode("SMS_166776550"); | |
508 | - $result = $this->aliSms->execute($this->req); | |
509 | - return $result; | |
510 | - } | |
511 | - | |
512 | - /** | |
513 | - * 工程师修改手机验证码 | |
514 | - * 验证码:${code},10分钟内有效。您正在申请修改手机号码 | |
515 | - * @param $phone | |
516 | - * @return mixed | |
517 | - */ | |
518 | - public function sendEngineerPhoneCode($phone, $code) | |
519 | - { | |
520 | - $this->req->setSmsType("normal"); | |
521 | - $this->req->setRecNum($phone); | |
522 | - $params = json_encode(['code' => (string)$code]); | |
523 | - $this->req->setSmsParam($params); | |
524 | - $this->req->setSmsTemplateCode("SMS_169642915"); | |
525 | - $result = $this->aliSms->execute($this->req); | |
526 | - return $result; | |
527 | - } | |
528 | - | |
529 | - /** | |
530 | - * 订单宝: 订单宝-自有订单通知 | |
531 | - * 模版内容: 您收到一张自有订单,设备“${device}”。进入公众号,您可以自己接单或者把订单转给其他工程师处理。 | |
532 | - * 申请说明: 用于通知工程师收到新的专属订单 | |
533 | - * @param $phone | |
534 | - * @return mixed | |
535 | - */ | |
536 | - public function sendPrivateNewOrderMsg($phone, $device) | |
537 | - { | |
538 | - $this->req->setSmsType("normal"); | |
539 | - $this->req->setRecNum($phone); | |
540 | - | |
541 | - $params = json_encode(['device' => (string)$device]); | |
542 | - $this->req->setSmsParam($params); | |
543 | - | |
544 | - $this->req->setSmsTemplateCode("SMS_173474941"); | |
545 | - $result = $this->aliSms->execute($this->req); | |
546 | - return $result; | |
547 | - } | |
548 | - | |
549 | - /** | |
550 | - * 订单宝: 订单宝-转出订单通知 | |
551 | - * 模版内容: 您收到了一张“${device}”设备的转出订单,马上打开极窝订单宝微信公众号查看吧~ | |
552 | - * 申请说明: 用于通知工程师收到新的专属订单 | |
553 | - * @param $phone | |
554 | - * @return mixed | |
555 | - */ | |
556 | - public function sendPrivateForwardOrderMsg($phone, $device) | |
557 | - { | |
558 | - $this->req->setSmsType("normal"); | |
559 | - $this->req->setRecNum($phone); | |
560 | - | |
561 | - $params = json_encode(['device' => (string)$device]); | |
562 | - $this->req->setSmsParam($params); | |
563 | - | |
564 | - $this->req->setSmsTemplateCode("SMS_173474272"); | |
565 | - $result = $this->aliSms->execute($this->req); | |
566 | - return $result; | |
567 | - } | |
568 | - | |
569 | - /** | |
570 | - * 工程师接自有订单单成功短信模板(自有订单) | |
571 | - * 模版内容: 您的“${device}”维修订单已经被${engineer}接单,稍后工程师会与您电话联系。进入“订单宝客户端”微信小程序查看订单进度。 | |
572 | - * 申请说明: 工程师接单成功短信提醒 | |
573 | - */ | |
574 | - public function sendPickPrivateOrderNotice($phone, $device, $engineer, $signName = '') | |
575 | - { | |
576 | - // 设置短信签名 | |
577 | - if (!empty($signName)) { | |
578 | - $this->req->setSmsFreeSignName($signName); | |
579 | - } | |
580 | - | |
581 | - $this->req->setSmsType("normal"); | |
582 | - $this->req->setSmsParam("{device:" . $device . ", engineer:" . $engineer . "}"); | |
583 | - $this->req->setRecNum($phone); | |
584 | - $this->req->setSmsTemplateCode("SMS_173760001"); | |
83 | + $this->req->setSmsTemplateCode("SMS_180755775"); | |
585 | 84 | $result = $this->aliSms->execute($this->req); |
586 | 85 | return $result; |
587 | 86 | } |
588 | - | |
589 | 87 | } |
590 | 88 | \ No newline at end of file | ... | ... |
domain/system/message/SmsMessage.php
... | ... | @@ -17,43 +17,13 @@ class SmsMessage |
17 | 17 | { |
18 | 18 | // 短信消息类型 |
19 | 19 | const TYPE_REG_CODE = 1; // sendRegCode-验证码发送 |
20 | - const TYPE_BIND_PHONE_SUCCESS = 2; // sendBindPhoneSuccessMsg-绑定手机号成功 | |
21 | - const TYPE_RESEND_BIND_PHONE = 3; // reSendBindPhoneCouponMsg-补发首单有礼优惠券短信 | |
22 | - const TYPE_WARRANTY_APPLY = 4; // sendWarrantyApplyMsg-发送质保申请通知 | |
23 | - const TYPE_NEW_ORDER = 6; // sendNewOrderMsg-发送新订单通知 | |
24 | - const TYPE_CLOSE_ORDER = 7; // sendCloseOrderMsg-系统关闭订单通知 | |
25 | - const TYPE_BIND_DEVICE_SUCCESS = 8; // sendBindDeviceSuccessMsg-发送设备绑定成功通知 | |
26 | - const TYPE_BIND_DEVICE_FAIL = 9; // sendBindDeviceFailMsg-发送设备绑定失败通知 | |
27 | - const TYPE_SKILL_AUTH_SUCCESS = 10; // sendSkillAuthSuccessMsg-发送技能认证成功通知 | |
28 | - const TYPE_SKILL_AUTH_FAIL = 11; // sendSkillAuthFailMsg-发送技能认证失败通知 | |
29 | - const TYPE_USER_AUTH_SUCCESS = 12; // sendUserAuthSuccessMsg-发送实名认证成功通知 | |
30 | - const TYPE_USER_AUTH_FAIL = 13; // sendUserAuthFailMsg-发送实名认证失败通知 | |
31 | - const TYPE_NO_MONEY_NOTICE = 14; // sendNoMoneyNotice-余额不足提醒 | |
32 | - const TYPE_INVOICE_NOTICE = 15; // sendInvoiceNotice-发票已经发送提醒 | |
33 | - const TYPE_SKILL_PRACTICE_SUCCESS = 16; // sendSkillPracticeSuccessMsg-通过技能实操考核 | |
34 | - const TYPE_WECHAT_PAY_NOTICE = 17; // sendWechatPayNotice-微信支付接口告警 | |
35 | - const TYPE_BLOCK_ENGINEER = 18; // sendBlockEngineerMsg-封号工程师 | |
36 | - const TYPE_UNBLOCK_ENGINEER = 19; // sendUnblockEngineerMsg-解封工程师 | |
37 | - const TYPE_CUSTOM_SERVICE_WARRANTY_DELAY = 20; // sendCustomServiceWarrantyDelayMsg 【客服】48小时质保申请延期通知 | |
38 | - const TYPE_NO_MONEY_WARNING = 21; // sendNoMoneyWarning-商户后台账户余额不足警告 | |
39 | - const TYPE_ENGINEER_PICK_ORDER = 22; // sendPickOrderNotice-工程师接单给用户发短信 | |
40 | - const TYPE_ENGINEER_CANCEL_ORDER = 23; // sendEngineerCancelOrderNotice-工程师取消订单给用户发短信 | |
41 | - const TYPE_CUSSTOM_SERVICE_FREQ_WARRANTY = 24; // sendCustomServiceFreqWarrantyMsg 【客服】工程师频繁质保通知 | |
42 | - const TYPE_NEW_YEAR_USER_RED_PACK = 25; // sendUserRedPackNotice 发送用户新年红包 | |
43 | - const TYPE_NEW_YEAR_USER_RED_PACK_HAS_ORDER = 26; // sendUserRedPackNoticeHasOrder 发送用户新年红包带口令 | |
44 | - const TYPE_THANK_FEE_NOTICE = 27; // sendThankFeeNotice 感谢费 | |
45 | - const TYPE_ENGINEER_PHONE_CODE = 28; // sendEngineerPhoneCode 工程师手机验证码 | |
46 | - | |
47 | - // 订单宝新增 | |
48 | - const TYPE_DDB_PRIVATE_NEW_ORDER = 29; // sendPrivateNewOrderMsg-订单宝-自有订单通知 | |
49 | - const TYPE_ENGINEER_PICK_PRIVATE_ORDER = 30; // sendPickPrivateOrderNotice 给客户发送工程师接单消息 | |
50 | - const TYPE_DDB_PRIVATE_FORWARD_ORDER = 31; // sendPrivateForwardOrderMsg-订单宝-转出订单通知 | |
20 | + const TYPE_GET_CODE = 2; // sendGetCode-提取码发送 | |
51 | 21 | |
52 | 22 | /** |
53 | 23 | * 短信签名类型 |
54 | 24 | */ |
55 | - const SIGN_NAME_JIWORK = "极办公"; | |
56 | - const SIGN_NAME_JIWO = "极窝"; | |
25 | + const SIGN_NAME_ZHLKJ = "周合立科技"; | |
26 | + const SIGN_NAME_ZHL = "周合立"; | |
57 | 27 | |
58 | 28 | /** |
59 | 29 | * 短信发送内部处理: 如果是异步模式,那么加入队列; 非异步模式的话,直接发。 | ... | ... |