|
@@ -134,13 +134,16 @@ class EmailSend extends Base
|
|
|
return json(['code' => 100, 'msg' => '请先填写邮件内容']);
|
|
|
}
|
|
|
|
|
|
- $resEmail = explode('&&',$param['to']);
|
|
|
+ $resEmail = explode(' ',$param['to']);
|
|
|
+
|
|
|
foreach ($resEmail as $v) {
|
|
|
+ if ($v == '') return json(['code' => 100,'msg' => '空格间隔过长,请检查']);
|
|
|
$res = Db::name('customer')->where('email',$v)->where('spread_id',session('uid'))->find();
|
|
|
if (!$res) {
|
|
|
return json(['code' => 100,'msg' => $v.'此邮箱不存在']);
|
|
|
}
|
|
|
}
|
|
|
+ var_dump($resEmail);die;
|
|
|
$to_email = Db::table('think_email')->where('id', 'in', $param['email_id'])->select();
|
|
|
$theme = Db::table('think_email_template')->where('id', $param['theme'])->value('theme');
|
|
|
$send_email = Db::name('customer')->where('email', 'in', implode(',',$resEmail))->where('spread_id',session('uid'))->field('id,email')->select();
|
|
@@ -208,7 +211,7 @@ class EmailSend extends Base
|
|
|
$data['theme'] = $theme;
|
|
|
$data['theme_id'] = $param['theme'];
|
|
|
$data['content'] = $param['content'];
|
|
|
- $data['email_id'] = $param['email_id'];
|
|
|
+ $data['email_id'] = $v['id'];
|
|
|
$data['send_type'] = $n['send_type'];
|
|
|
$data['spread_id'] = session('uid');
|
|
|
$data['create_time'] = time();
|
|
@@ -258,7 +261,7 @@ class EmailSend extends Base
|
|
|
$email = Db::name('customer')->where('id','in',$ids)->where('status','in','0,1,2')->column('email');
|
|
|
$id = explode(',', $ids);
|
|
|
// $this->assign('customer', $customer);
|
|
|
- $this->assign('emial' ,implode('&&',$email));
|
|
|
+ $this->assign('emial' ,implode(' ',$email));
|
|
|
$this->assign('ids', $ids);
|
|
|
} else {
|
|
|
$customer = Db::name('customer')->where('spread_id', session('uid'))->where('status','in','0,1,2')->field('id,email,name')->select();
|
|
@@ -384,9 +387,10 @@ class EmailSend extends Base
|
|
|
public function editDraft()
|
|
|
{
|
|
|
$data = $this->request->param();
|
|
|
- $resEmail = explode('&&',$data['to']);
|
|
|
+ $resEmail = explode(' ',$data['to']);
|
|
|
// var_dump($data);die;
|
|
|
foreach ($resEmail as $v) {
|
|
|
+ if ($v == '') return json(['code' => 100,'msg' => '空格间隔过长,请检查']);
|
|
|
$res = Db::name('customer')->where('email',$v)->where('spread_id',session('uid'))->find();
|
|
|
if (!$res) {
|
|
|
return json(['code' => 100,'msg' => $v.'此邮箱不存在']);
|