|
@@ -7,6 +7,7 @@
|
|
*/
|
|
*/
|
|
namespace app\admin\controller;
|
|
namespace app\admin\controller;
|
|
use app\admin\model\CustomerModel;
|
|
use app\admin\model\CustomerModel;
|
|
|
|
+use app\admin\model\EmailSendModel;
|
|
use app\admin\model\EmailsModel;
|
|
use app\admin\model\EmailsModel;
|
|
use app\admin\model\EmailTemplateModel;
|
|
use app\admin\model\EmailTemplateModel;
|
|
use app\admin\model\UserModel;
|
|
use app\admin\model\UserModel;
|
|
@@ -36,24 +37,25 @@ class EmailSends extends Base
|
|
$od = "create_time desc";
|
|
$od = "create_time desc";
|
|
}
|
|
}
|
|
$emails =new EmailTemplateModel();
|
|
$emails =new EmailTemplateModel();
|
|
-
|
|
|
|
|
|
+ $emailSend = new EmailSendModel();
|
|
$count = $emails->getCount($map);
|
|
$count = $emails->getCount($map);
|
|
- $lists = $emails->getByWhere($map, $od, $Nowpage, $limits);
|
|
|
|
|
|
+ $lists = $emailSend->getByWhere($map, $od, $Nowpage, $limits);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($lists as $k=>&$v){
|
|
foreach($lists as $k=>&$v){
|
|
- $v['shou']='<a href="export?id='.$v['id'].'" style="color:#3BA1FF">下载全部收件人邮箱</a>';
|
|
|
|
- $v['count']=Db::table('think_email_send')->where('theme_id',$v['id'])->count();//全部
|
|
|
|
- $v['count1']=Db::table('think_email_send')->where('theme_id',$v['id'])->where('status',1)->count();//已发送
|
|
|
|
- $v['count2']=Db::table('think_email_send')->where('theme_id',$v['id'])->where('status',0)->count();//未发送
|
|
|
|
- $v['count3']=Db::table('think_email_send')->where('theme_id',$v['id'])->where('status',2)->count();//已取消
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if($v['type']==2){
|
|
|
|
- $v['remark']='草稿';
|
|
|
|
- $v['is_edit']=1;
|
|
|
|
- }elseif($v['count']>0 && $v['count2']>0 && $v['count3']==0){
|
|
|
|
|
|
+ $v['shou']='<a href="export?uni='.$v['uni'].'" style="color:#3BA1FF">下载全部收件人邮箱</a>';
|
|
|
|
+ $v['count']=Db::table('think_email_send')->where('uni',$v['uni'])->count();//全部
|
|
|
|
+ $v['count1']=Db::table('think_email_send')->where('uni',$v['uni'])->where('status',1)->count();//已发送
|
|
|
|
+ $v['count2']=Db::table('think_email_send')->where('uni',$v['uni'])->where('status',0)->count();//未发送
|
|
|
|
+ $v['count3']=Db::table('think_email_send')->where('uni',$v['uni'])->where('status',2)->count();//已取消
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// if($v['type']==2){
|
|
|
|
+// $v['remark']='草稿';
|
|
|
|
+// $v['is_edit']=1;
|
|
|
|
+// }else
|
|
|
|
+ if($v['count']>0 && $v['count2']>0 && $v['count3']==0){
|
|
$v['remark']='发送中('.$v['count1'].'/'.$v['count'].')';
|
|
$v['remark']='发送中('.$v['count1'].'/'.$v['count'].')';
|
|
$v['is_edit']=0;
|
|
$v['is_edit']=0;
|
|
$v['is_stop']=1;
|
|
$v['is_stop']=1;
|
|
@@ -72,12 +74,13 @@ class EmailSends extends Base
|
|
$v['is_edit']=1;
|
|
$v['is_edit']=1;
|
|
}
|
|
}
|
|
|
|
|
|
- $v['send_time']=Db::table('think_email_send')->where('theme_id',$v['id'])->order('send_time desc')->value('send_time');
|
|
|
|
|
|
+ $v['send_time']=Db::table('think_email_send')->where('uni',$v['uni'])->where('status', 1)->order('send_time desc')->value('send_time');
|
|
if($v['send_time']){
|
|
if($v['send_time']){
|
|
- $v['send_time']=date('Y-m-d H:i:s',$v['send_time']);
|
|
|
|
|
|
+ $v['send_time']=date('Y-m-d H:i:s',$v['send_time']).'-('.$v['count1'].'/'.$v['count'].')';
|
|
|
|
|
|
}else{
|
|
}else{
|
|
- $v['send_time']='未发送';
|
|
|
|
|
|
+ $n['send_time']=Db::table('think_email_send')->where('uni',$v['uni'])->order('send_time desc')->value('send_time');
|
|
|
|
+ $v['send_time']=date('Y-m-d H:i:s',$n['send_time']).'-('.$v['count1'].'/'.$v['count'].')';
|
|
}
|
|
}
|
|
|
|
|
|
$v['username']=Db::table('think_admin')->where('id',$v['spread_id'])->value('username');
|
|
$v['username']=Db::table('think_admin')->where('id',$v['spread_id'])->value('username');
|