|
@@ -7,11 +7,14 @@ use app\common\controller\TeacherBase; |
|
@@ -7,11 +7,14 @@ use app\common\controller\TeacherBase; |
|
7
|
use app\school\model\basic\Clazz;
|
7
|
use app\school\model\basic\Clazz;
|
|
8
|
use app\school\model\basic\College;
|
8
|
use app\school\model\basic\College;
|
|
9
|
use app\school\model\basic\Specialty;
|
9
|
use app\school\model\basic\Specialty;
|
|
|
|
10
|
+use EasyWeChat\Factory;
|
|
10
|
use fast\Random;
|
11
|
use fast\Random;
|
|
|
|
12
|
+use Overtrue\Socialite\AuthorizeFailedException;
|
|
11
|
use think\addons\Service;
|
13
|
use think\addons\Service;
|
|
12
|
use think\Cache;
|
14
|
use think\Cache;
|
|
13
|
use think\Config;
|
15
|
use think\Config;
|
|
14
|
use think\Db;
|
16
|
use think\Db;
|
|
|
|
17
|
+use think\Exception;
|
|
15
|
use think\Lang;
|
18
|
use think\Lang;
|
|
16
|
use Upyun\Upyun;
|
19
|
use Upyun\Upyun;
|
|
17
|
|
20
|
|
|
@@ -22,7 +25,8 @@ use Upyun\Upyun; |
|
@@ -22,7 +25,8 @@ use Upyun\Upyun; |
|
22
|
class Ajax extends TeacherBase
|
25
|
class Ajax extends TeacherBase
|
|
23
|
{
|
26
|
{
|
|
24
|
|
27
|
|
|
25
|
- protected $noNeedLogin = ['lang','canvas','upyun_upload'];
|
28
|
+ protected $noNeedLogin = ['lang'];
|
|
|
|
29
|
+ //'canvas','upyun_upload'
|
|
26
|
protected $noNeedRight = ['*'];
|
30
|
protected $noNeedRight = ['*'];
|
|
27
|
protected $layout = '';
|
31
|
protected $layout = '';
|
|
28
|
|
32
|
|
|
@@ -310,9 +314,13 @@ class Ajax extends TeacherBase |
|
@@ -310,9 +314,13 @@ class Ajax extends TeacherBase |
|
310
|
public function canvas(){
|
314
|
public function canvas(){
|
|
311
|
$id = input('id');
|
315
|
$id = input('id');
|
|
312
|
if ($this->request->isPost()){
|
316
|
if ($this->request->isPost()){
|
|
313
|
- if (!$id) $this->error('用户数据异常');
|
317
|
+ if (!$id) $this->error('用户项目数据异常');
|
|
|
|
318
|
+ if (!$this->auth) $this->error('当前登录用户数据异常');
|
|
|
|
319
|
+ $teacher_name = $this->auth['username'];
|
|
314
|
$teacher_id = $this->auth['id'];
|
320
|
$teacher_id = $this->auth['id'];
|
|
315
|
- $detail = Db::table('fa_project_register')->where(['review_stage' => 0,'project_approval_status' => 0,'item_id' => $id])->find();
|
321
|
+ $detail = Db::table('fa_project_register')->where(['id' => $id])->find();
|
|
|
|
322
|
+ if ($detail['review_stage'] != 0) $this->error('用户项目数据不在立项评审阶段');
|
|
|
|
323
|
+ if ($detail['project_approval_status'] != 0) $this->error('用户项目数据不在立项审核阶段');
|
|
316
|
if (!$detail) $this->error('项目数据异常');
|
324
|
if (!$detail) $this->error('项目数据异常');
|
|
317
|
//判断是否是审核成员
|
325
|
//判断是否是审核成员
|
|
318
|
$member_ids = Db::table('fa_members')
|
326
|
$member_ids = Db::table('fa_members')
|
|
@@ -345,9 +353,8 @@ class Ajax extends TeacherBase |
|
@@ -345,9 +353,8 @@ class Ajax extends TeacherBase |
|
345
|
}
|
353
|
}
|
|
346
|
}
|
354
|
}
|
|
347
|
//通过:project_approval_status => 1 退回:project_status => 2
|
355
|
//通过:project_approval_status => 1 退回:project_status => 2
|
|
348
|
-
|
|
|
|
349
|
$data['signature_url'] = $file_url;
|
356
|
$data['signature_url'] = $file_url;
|
|
350
|
- $data['updatetime'] = time();
|
357
|
+ $data['updatetime'] = time();
|
|
351
|
if ($type == 2){
|
358
|
if ($type == 2){
|
|
352
|
$data['project_status'] = 2;
|
359
|
$data['project_status'] = 2;
|
|
353
|
$msg = '退回';
|
360
|
$msg = '退回';
|
|
@@ -356,6 +363,8 @@ class Ajax extends TeacherBase |
|
@@ -356,6 +363,8 @@ class Ajax extends TeacherBase |
|
356
|
$msg = '通过';
|
363
|
$msg = '通过';
|
|
357
|
}
|
364
|
}
|
|
358
|
Db::table("fa_project_register")->where('id',$id)->update($data);
|
365
|
Db::table("fa_project_register")->where('id',$id)->update($data);
|
|
|
|
366
|
+ //项目类型
|
|
|
|
367
|
+ $project_type_name = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
|
|
359
|
//fa_register_log project_type_name => fa_project_register.project_type--fa_project_type
|
368
|
//fa_register_log project_type_name => fa_project_register.project_type--fa_project_type
|
|
360
|
$log['register_id'] = $id;
|
369
|
$log['register_id'] = $id;
|
|
361
|
$log['container_id'] = $detail['container_id'];
|
370
|
$log['container_id'] = $detail['container_id'];
|
|
@@ -366,13 +375,30 @@ class Ajax extends TeacherBase |
|
@@ -366,13 +375,30 @@ class Ajax extends TeacherBase |
|
366
|
$log['verify_stage'] = 0;
|
375
|
$log['verify_stage'] = 0;
|
|
367
|
$log['project_name'] = $detail['project_name'];
|
376
|
$log['project_name'] = $detail['project_name'];
|
|
368
|
$log['project_type'] = $detail['project_type'];
|
377
|
$log['project_type'] = $detail['project_type'];
|
|
369
|
- $log['project_type_name'] = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
|
378
|
+ $log['project_type_name'] = $project_type_name;
|
|
370
|
$log['created_time'] = datetime('Y-m-d H:i:s',time());
|
379
|
$log['created_time'] = datetime('Y-m-d H:i:s',time());
|
|
371
|
- $log['teacher_name'] = $this->auth['teacher_name'];
|
380
|
+ $log['teacher_name'] = $teacher_name;
|
|
372
|
$log['job_num'] = $this->auth['job_num'];
|
381
|
$log['job_num'] = $this->auth['job_num'];
|
|
373
|
$log['operation'] = '项目审核' . $msg;
|
382
|
$log['operation'] = '项目审核' . $msg;
|
|
374
|
- $log['memo'] = '项目审核';
|
383
|
+ $log['memo'] = $opinion;
|
|
375
|
Db::table("fa_register_log")->insert($log);
|
384
|
Db::table("fa_register_log")->insert($log);
|
|
|
|
385
|
+ $open_id = Db::table('fa_user')->where('id',$detail['user_id'])->value('open_id');
|
|
|
|
386
|
+ $config = Config::get('officialAccount');
|
|
|
|
387
|
+ $app = Factory::officialAccount($config);
|
|
|
|
388
|
+ $app->template_message->send([
|
|
|
|
389
|
+ 'touser' => $open_id,
|
|
|
|
390
|
+ 'template_id' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',
|
|
|
|
391
|
+ 'data' => array(
|
|
|
|
392
|
+ 'first' => array('value' => "项目审核结果通知", 'color' => ''),
|
|
|
|
393
|
+ 'keyword1' => array('value' => $project_type_name, 'color' => ''),
|
|
|
|
394
|
+ 'keyword2' => array('value' => $detail['project_name'], 'color' => ''),
|
|
|
|
395
|
+ 'keyword3' => array('value' => $msg, 'color' => ''),
|
|
|
|
396
|
+ 'keyword4' => array('value' => $teacher_name, 'color' => ''),
|
|
|
|
397
|
+ 'keyword5' => array('value' => $opinion, 'color' => ''),
|
|
|
|
398
|
+ 'remark' => array('value' => '【您报名参加的' . $detail['project_name'] . '】被' . $msg, 'color' => ''),
|
|
|
|
399
|
+ ),
|
|
|
|
400
|
+ ]);
|
|
|
|
401
|
+
|
|
376
|
$this->success('操作成功',$file_url);
|
402
|
$this->success('操作成功',$file_url);
|
|
377
|
}
|
403
|
}
|
|
378
|
$this->view->assign('id',$id);
|
404
|
$this->view->assign('id',$id);
|