...
|
...
|
@@ -138,10 +138,38 @@ class Job extends Base { |
|
|
$jobId = app()->request('id', 0, 'intval');
|
|
|
$ret = db()->first(sendJobsSql::find($jobId));
|
|
|
|
|
|
if(!$ret || !in_array($ret['email_id'],$this->getEmails('id'))){
|
|
|
app()->e('数据不存在');
|
|
|
}
|
|
|
|
|
|
app()->_json($ret);
|
|
|
}
|
|
|
|
|
|
|
|
|
public function save(){
|
|
|
$jobId = app()->request('id', 0, 'intval');
|
|
|
$ret = db()->first(sendJobsSql::find($jobId));
|
|
|
|
|
|
if(!$ret || !in_array($ret['email_id'],$this->getEmails('id'))){
|
|
|
app()->e('数据不存在');
|
|
|
}
|
|
|
|
|
|
$ret['maildata'] = json_decode($ret['maildata'],true);
|
|
|
|
|
|
$ret['maildata']['subject'] = app()->request('subject');
|
|
|
$ret['maildata']['body'] = app()->request('body');
|
|
|
|
|
|
$r = db()->update(sendJobsSql::$table,[
|
|
|
'maildata'=>json_encode($ret['maildata'])
|
|
|
],"`id` = $jobId");
|
|
|
|
|
|
if($r){
|
|
|
return ['status'=>200];
|
|
|
}
|
|
|
|
|
|
app()->e('保存失败');
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
...
|
...
|
|