linwu 1 день назад
Родитель
Сommit
be4acd25e9

+ 5 - 15
api/applet/controller/AppletController.php

@@ -3,6 +3,7 @@ namespace api\applet\controller;
 
 use api\applet\model\UserModel;
 use api\common\Http;
+use api\common\Sms;
 use cmf\controller\RestBaseController;
 use think\Db;
 
@@ -62,22 +63,11 @@ class AppletController extends RestBaseController
 
     public function test()
     {
-        /*$url = 'https://api.weixin.qq.com/cgi-bin/openapi/rid/get?access_token={$token}';
-        $data = '{"rid":1}';
-        $header = ['content-type: application/json'];
-        $result = Http::http_post_json($url, $data, $header);
-        halt($result);*/
+        //短信
+        /*$sms = new Sms();
+        $sms->send('13313826760','talent_appointment_end');*/
 
-        $url = "https://cnapi.sciener.com/oauth2/token";
-        $data = [
-            'clientId' => '3280d286853f4588addae034f855333e',
-            'clientSecret' => 'b1a083bbd1bda2343828deddaa579f19',
-            'username' => '+86159607153161',
-            'password' => md5('qwe123456'),
-        ];
-        $header = ['Content-Type: application/x-www-form-urlencoded'];
-        $result = Http::http_post_json($url, $data, $header);
-        halt($result);
+        $this->success('发送成功');
     }
 
     public function t2()

+ 17 - 3
api/talent/controller/AdminController.php

@@ -56,6 +56,10 @@ class AdminController extends RestUserBaseController
 
         $talent = TalentModel::get($appointment['talent_id']);
 
+        //短信
+        $sms = new Sms();
+        $sms->send($talent['mobile'],'talent_appointment_end');
+
         $this->success('成功', ['talent' => $talent, 'appointment' => $appointment]);
     }
 
@@ -83,7 +87,10 @@ class AdminController extends RestUserBaseController
     public function confirm()
     {
         $data = $this->request->param();
-        TalentAppointmentModel::update(['status'=>2,'apply_code'=>uniqid()],['id'=>$data['id']]);
+        $talent_appointment = TalentAppointmentModel::get($data['id']);
+        $talent_appointment->status = 2;
+        $talent_appointment->apply_code = uniqid();
+        $talent_appointment->save();
 
         //日志
         $admin = TalentAdminModel::get($data['admin_id']);
@@ -94,9 +101,12 @@ class AdminController extends RestUserBaseController
             'create_time'    => date('Y-m-d H:i:s'),
         ]);
 
+        //人才信息
+        $talent = TalentModel::where('id',$talent_appointment['talent_id'])->find();
+
         //短信
-//        $sms = new Sms();
-//        $sms->send('13313826760','verification_code',['code'=>'123456']);
+        $sms = new Sms();
+        $sms->send($talent['mobile'],'talent_appointment_confirm');
 
         $this->success();
     }
@@ -136,6 +146,10 @@ class AdminController extends RestUserBaseController
             'create_time'    => date('Y-m-d H:i:s'),
         ]);
 
+        //短信
+        $sms = new Sms();
+        $sms->send($appointment['talent']['mobile'],'talent_appointment_end');
+
         $this->success('成功');
     }
 }

+ 6 - 0
api/talent/controller/AppointmentController.php

@@ -4,6 +4,7 @@ namespace api\talent\controller;
 
 
 use api\applet\model\UserModel;
+use api\common\Sms;
 use app\talent\model\TalentAppointmentLogModel;
 use app\talent\model\TalentAppointmentModel;
 use app\talent\model\TalentModel;
@@ -71,6 +72,11 @@ class AppointmentController extends RestUserBaseController
             'create_time'    => date('Y-m-d H:i:s'),
         ]);
 
+        //短信
+        $sms = new Sms();
+        $option = cmf_get_option('talent_setting');
+        $sms->send($option['mobile'],'talent_appointment_submit');
+
         $this->success();
     }
 

+ 4 - 4
applet/app.js

@@ -2,10 +2,10 @@
 App({
   globalData: {
     title: '晋爱人才',
-    // http_host: 'http://bd.jarc.com/',
-    // api_host: 'http://bd.jarc.com/api/',
-    http_host: 'https://jarc.jucai.gov.cn/',
-    api_host: 'https://jarc.jucai.gov.cn/api/',
+    http_host: 'http://bd.jarc.com/',
+    api_host: 'http://bd.jarc.com/api/',
+    // http_host: 'https://jarc.jucai.gov.cn/',
+    // api_host: 'https://jarc.jucai.gov.cn/api/',
   },
   onLaunch: function() {
     var self = this;