|
...
|
...
|
@@ -7,11 +7,14 @@ use app\common\controller\TeacherBase; |
|
|
|
use app\school\model\basic\Clazz;
|
|
|
|
use app\school\model\basic\College;
|
|
|
|
use app\school\model\basic\Specialty;
|
|
|
|
use EasyWeChat\Factory;
|
|
|
|
use fast\Random;
|
|
|
|
use Overtrue\Socialite\AuthorizeFailedException;
|
|
|
|
use think\addons\Service;
|
|
|
|
use think\Cache;
|
|
|
|
use think\Config;
|
|
|
|
use think\Db;
|
|
|
|
use think\Exception;
|
|
|
|
use think\Lang;
|
|
|
|
use Upyun\Upyun;
|
|
|
|
|
|
...
|
...
|
@@ -22,7 +25,8 @@ use Upyun\Upyun; |
|
|
|
class Ajax extends TeacherBase
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $noNeedLogin = ['lang','canvas','upyun_upload'];
|
|
|
|
protected $noNeedLogin = ['lang'];
|
|
|
|
//'canvas','upyun_upload'
|
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
protected $layout = '';
|
|
|
|
|
|
...
|
...
|
@@ -310,20 +314,22 @@ class Ajax extends TeacherBase |
|
|
|
public function canvas(){
|
|
|
|
$id = input('id');
|
|
|
|
if ($this->request->isPost()){
|
|
|
|
if (!$id) $this->error('用户数据异常');
|
|
|
|
if (!$id) $this->error('用户项目数据异常');
|
|
|
|
if (!$this->auth) $this->error('当前登录用户数据异常');
|
|
|
|
$teacher_name = $this->auth['username'];
|
|
|
|
$teacher_id = $this->auth['id'];
|
|
|
|
$detail = Db::table('fa_project_register')->where(['review_stage' => 0,'project_approval_status' => 0,'item_id' => $id])->find();
|
|
|
|
$detail = Db::table('fa_project_register')->where(['id' => $id])->find();
|
|
|
|
if ($detail['review_stage'] != 0) $this->error('用户项目数据已审核过');
|
|
|
|
if ($detail['project_approval_status'] != 0) $this->error('用户项目数据已审核过');
|
|
|
|
if ($detail['project_status'] == 2) $this->error('用户项目数据已被退回');
|
|
|
|
if (!$detail) $this->error('项目数据异常');
|
|
|
|
//判断是否是审核成员
|
|
|
|
$member_ids = Db::table('fa_members')
|
|
|
|
->alias('m')
|
|
|
|
// ->field('m.container_id,m.member_id')
|
|
|
|
// ->join('fa_project_register p','m.container_id = p.container_id and m.item_id = p.id','LEFT')
|
|
|
|
->where(['m.member_type' => 2 ,'m.member_source' => 2,'m.item_id' => $id])
|
|
|
|
->where(['member_type' => 2 ,'member_source' => 2,'item_id' => $id])
|
|
|
|
->column('member_id');
|
|
|
|
if (!in_array($teacher_id,$member_ids)) $this->error('当前用户不是该项目审核人员');
|
|
|
|
$opinion = input('opinion');//意见
|
|
|
|
$type = input('type');//审核 1:通过 2:退回
|
|
|
|
$project_type = input('type');//审核 1:通过 2:退回
|
|
|
|
$imgbase64 = input('imgbase64');
|
|
|
|
$file_url = '';
|
|
|
|
//图片上传
|
|
...
|
...
|
@@ -345,10 +351,9 @@ class Ajax extends TeacherBase |
|
|
|
}
|
|
|
|
}
|
|
|
|
//通过:project_approval_status => 1 退回:project_status => 2
|
|
|
|
|
|
|
|
$data['signature_url'] = $file_url;
|
|
|
|
$data['updatetime'] = time();
|
|
|
|
if ($type == 2){
|
|
|
|
if ($project_type == 2){
|
|
|
|
$data['project_status'] = 2;
|
|
|
|
$msg = '退回';
|
|
|
|
}else{
|
|
...
|
...
|
@@ -356,6 +361,8 @@ class Ajax extends TeacherBase |
|
|
|
$msg = '通过';
|
|
|
|
}
|
|
|
|
Db::table("fa_project_register")->where('id',$id)->update($data);
|
|
|
|
//项目类型
|
|
|
|
$project_type_name = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
|
|
|
|
//fa_register_log project_type_name => fa_project_register.project_type--fa_project_type
|
|
|
|
$log['register_id'] = $id;
|
|
|
|
$log['container_id'] = $detail['container_id'];
|
|
...
|
...
|
@@ -366,13 +373,32 @@ class Ajax extends TeacherBase |
|
|
|
$log['verify_stage'] = 0;
|
|
|
|
$log['project_name'] = $detail['project_name'];
|
|
|
|
$log['project_type'] = $detail['project_type'];
|
|
|
|
$log['project_type_name'] = Db::table('fa_project_type')->where('id',$detail['project_type'])->value('name');
|
|
|
|
$log['project_type_name'] = $project_type_name;
|
|
|
|
$log['created_time'] = datetime('Y-m-d H:i:s',time());
|
|
|
|
$log['teacher_name'] = $this->auth['teacher_name'];
|
|
|
|
$log['teacher_name'] = $teacher_name;
|
|
|
|
$log['job_num'] = $this->auth['job_num'];
|
|
|
|
$log['operation'] = '项目审核' . $msg;
|
|
|
|
$log['memo'] = '项目审核';
|
|
|
|
$log['memo'] = $opinion;
|
|
|
|
Db::table("fa_register_log")->insert($log);
|
|
|
|
$open_id = Db::table('fa_user')->where('id',$detail['user_id'])->value('open_id');
|
|
|
|
if ($open_id){
|
|
|
|
$config = Config::get('officialAccount');
|
|
|
|
$app = Factory::officialAccount($config);
|
|
|
|
$app->template_message->send([
|
|
|
|
'touser' => $open_id,
|
|
|
|
'template_id' => 'QUWHawyGohboStMgzZ4B4vQbqeFGWEnd-6MPh7jM8QQ',
|
|
|
|
'data' => array(
|
|
|
|
'first' => array('value' => "项目审核结果通知", 'color' => ''),
|
|
|
|
'keyword1' => array('value' => $project_type_name, 'color' => ''),
|
|
|
|
'keyword2' => array('value' => $detail['project_name'], 'color' => ''),
|
|
|
|
'keyword3' => array('value' => $msg, 'color' => ''),
|
|
|
|
'keyword4' => array('value' => $teacher_name, 'color' => ''),
|
|
|
|
'keyword5' => array('value' => $opinion, 'color' => ''),
|
|
|
|
'remark' => array('value' => '【您报名参加的' . $detail['project_name'] . '】被' . $msg, 'color' => ''),
|
|
|
|
),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->success('操作成功',$file_url);
|
|
|
|
}
|
|
|
|
$this->view->assign('id',$id);
|
...
|
...
|
|