Browse Source

发送导入成功短信

sandm 2 năm trước cách đây
mục cha
commit
7629a66500
2 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 2 4
      app/index/controller/Auth.php
  2. 3 0
      app/job/Import.php

+ 2 - 4
app/index/controller/Auth.php

@@ -224,10 +224,8 @@ class Auth extends BaseController {
     }
 
     public function test(){
-        $redis = new \Redis();
-        $redis->connect("192.168.51.99", 6379);
-        $redis->auth("jjhc2019");
-        dd($redis->get('test'));
+        $sms = new \app\common\api\ChuanglanSmsApi();
+        $sms->sendSMS('18060002035', "您好,您的机构信息仍需完善,请登录晋江市人才综合服务申报平台进行完善,您的用户名为:test,密码为:test。");
     }
 
 }

+ 3 - 0
app/job/Import.php

@@ -142,6 +142,9 @@ class Import {
                             $item['createTime'] = date("Y-m-d H:i:s", time());
                             Db::table("un_enterprise")->insert($item);
                             $sheet->setCellValue('L' . ($index + 2), '导入成功,初始账号为:' . $item['idCard'] . ',初始密码为:' . $password);
+                            $sender = new ChuanglanSmsApi();
+                            $sender->sendSMS($item['agentPhone'], "您好,您的机构信息仍需完善,请登录晋江市人才综合服务申报平台进行完善,您的用户名为:{$item['idCard']},密码为:{$password}。");
+
                         }
                     }