diff --git a/application/api/controller/Suggest.php b/application/api/controller/Suggest.php index ea30ec1..7d0111f 100644 --- a/application/api/controller/Suggest.php +++ b/application/api/controller/Suggest.php @@ -206,8 +206,8 @@ class Suggest extends Controller{ $where['t_suggest.suggest_state'] = $data['suggest_state']; } $res['data'] = $this->suggest_obj->field('t_suggest.*,t_user.realname,t_problem.problem_title') - ->join('t_user','t_user.user_id = t_suggest.user_id','RIGHT') - ->join('t_problem','t_problem.problem_id = t_suggest.problem_id','RIGHT') + ->join('t_user','t_user.user_id = t_suggest.user_id','LEFT') + ->join('t_problem','t_problem.problem_id = t_suggest.problem_id','LEFT') ->where($where) ->page($data['pageIndex'],$data['pageSize']) ->select(); @@ -237,8 +237,8 @@ class Suggest extends Controller{ return json(['code' => 1,'msg'=>$rule->getError()]); } $res = $this->suggest_obj->field('t_suggest.*,t_user.realname,t_problem.problem_title') - ->join('t_user','t_user.user_id = t_suggest.user_id','RIGHT') - ->join('t_problem','t_problem.problem_id = t_suggest.problem_id','RIGHT') + ->join('t_user','t_user.user_id = t_suggest.user_id','LEFT') + ->join('t_problem','t_problem.problem_id = t_suggest.problem_id','LEFT') ->where(['t_suggest.suggest_id'=>$data['suggest_id']]) ->find(); return jsonSuccess($res); @@ -307,7 +307,8 @@ class Suggest extends Controller{ 'sendPassword'=>Env::get('email.send_email_password'), // 发件人密码 'user_id'=>$userID, //收件人ID 'email'=>$email,// 收件人邮箱 - 'title'=>'TMR', // 邮件标题 + 'title'=>'Dear ' . $realname, // 邮件标题 + 'from_name'=>'TMR', 'content'=>getUserEmail($realname,$caseId),//邮件内容 ]; if(isset($insert['suggest_url'])){ @@ -324,7 +325,8 @@ class Suggest extends Controller{ 'sendPassword'=>Env::get('email.send_email_password'), // 发件人密码 'user_id'=>0, 'email'=>Env::get('email.editor_email'),// 收件人邮箱 - 'title'=>'TMR', // 邮件标题 + 'title'=>'Dear editor', // 邮件标题 + 'from_name'=>'TMR', 'content'=>"Dear editor, please check the new feedback.",//邮件内容 ]; return $editorData; diff --git a/application/api/job/domail.php b/application/api/job/domail.php index 501f57f..a949271 100644 --- a/application/api/job/domail.php +++ b/application/api/job/domail.php @@ -20,7 +20,7 @@ class domail { * @param type $data */ public function send($data){ - $res = sendEmail($data['email'],$data['title'],$data['title'],$data['content'],$data['sendEmail'],$data['sendPassword']); + $res = sendEmail($data['email'],$data['title'],$data['from_name'],$data['content'],$data['sendEmail'],$data['sendPassword'],$data['attachmentFile']=''); $insert = [ 'title'=>$data['title'], 'content'=>$data['content'], @@ -34,6 +34,9 @@ class domail { $insert['is_attachment'] = 1; $insert['attachment_url'] = $data['attachment_url']; } + if(isset($data['journal_id'])){ + $insert['journal_id'] = $data['journal_id']; + } if($res['status']==1){ $info = Db::name('email')->insert($insert); if(!$info){