作者 赵彬吉

updtae

@@ -81,18 +81,19 @@ class EmailController extends BaseController @@ -81,18 +81,19 @@ class EmailController extends BaseController
81 'host.regex' => 'smtp格式错误', 81 'host.regex' => 'smtp格式错误',
82 'from_name.required' => '发信人昵称必须', 82 'from_name.required' => '发信人昵称必须',
83 ]); 83 ]);
  84 + $this->param['project_id'] = $this->project['id'];
84 $info = $smtp->read(['project_id' => $this->project['id']]); 85 $info = $smtp->read(['project_id' => $this->project['id']]);
85 if (!$info) { 86 if (!$info) {
86 $smtp->add($this->param); 87 $smtp->add($this->param);
87 } else { 88 } else {
88 - $smtp->edit($this->param, ['project_id' => $this->param['project_id']]); 89 + $smtp->edit($this->param, ['project_id' => $this->project['id']]);
89 } 90 }
90 $this->response('success'); 91 $this->response('success');
91 } 92 }
92 93
93 public function get_smtp(Smtp $smtp){ 94 public function get_smtp(Smtp $smtp){
94 $info = $smtp->read(['project_id' => $this->project['id']]); 95 $info = $smtp->read(['project_id' => $this->project['id']]);
95 - $this->response($info); 96 + $this->response($info??[]);
96 } 97 }
97 98
98 public function group_send(GroupSendTask $groupSendTask) 99 public function group_send(GroupSendTask $groupSendTask)