bianjunhui il y a 2 ans
Parent
commit
540467ef05

+ 42 - 2
application/lib/data/adminAction.php

@@ -16,7 +16,12 @@ class AdvertAdminAction extends BaseAction{
 			$result = $this->getDbEntity()->query($sql);
 			return $result[0];
 		}
-		
+        //登录
+        public function selectUserName($uid){
+            $sql    = "select * from ly_user where id='$uid'  limit 1";
+            $result = $this->getDbEntity()->query($sql);
+            return $result[0];
+        }
 		//查询用户,通过uname
 		public function selectUserByName($uname){
 			$sql    = "select * from ly_user where uname='$uname' limit 1";
@@ -446,6 +451,26 @@ class AdvertAdminAction extends BaseAction{
         $result = $this->getDbEntity()->query($sql);
         return $result;
     }
+
+    //短信回执发送列表
+    public function select_smsdidlog_list($where,$limit=0){
+
+        if(!empty($limit)){
+            $sql    = "select *  from ly_send_sms_log_did  $where order by id desc limit $limit";
+        }else{
+            $sql    = "select *  from ly_send_sms_log_did  $where order by id desc";
+        }
+
+        $result = $this->getDbEntity()->query($sql);
+        return $result;
+    }
+    //查询短信发送数量
+    public function select_smsdidlog_count($where){
+        $sql    = "select count(*) as count  from ly_send_sms_log_did  $where ";
+        $result = $this->getDbEntity()->query($sql);
+        return $result[0]['count'];
+    }
+
     //短信发送列表
     public function select_smslog_list_query($where,$limit=0){
 
@@ -774,15 +799,30 @@ class AdvertAdminAction extends BaseAction{
             $result = $this->getDbEntity()->execute_sql($sql);
             return $result;
         }
+        //用户取消订阅
+        public function upDidSmsCustomer($is_send,$tel,$uid){
+            $sql    = "update ly_sms_customer set is_send='{$is_send}' where tel='{$tel}' and uid='{$uid}'";
+            $result = $this->getDbEntity()->execute_sql($sql);
+            return $result;
+        }
         //添加短信回执记录
         public  function addDrLog($data){
             $times=date('Y-m-d H:i:s');
-            $sql    = "insert into ly_send_sms_log_dr(mobile,dr_id,group_dr_id,status,result,addtime) values
+            $sql    = "insert into ly_send_sms_log_dr (mobile,dr_id,group_dr_id,status,result,addtime) values
                             ('{$data['phone']}','{$data['messageid']}','{$data['group_dr_id']}','{$data['status']}','{$data['result']}','{$times}')";
             $result = $this->getDbEntity()->execute_sql($sql);
             return $result;
         }
 
+        //添加短信回执记录
+        public  function addDidLog($data){
+            $times=date('Y-m-d H:i:s');
+            $sql    = "insert into ly_send_sms_log_did (mobile,from_phone,did_id,group_did_id,status,content,addtime,receive_time,did_mobile,uid) values
+                                ('{$data['mobile']}','{$data['fromPhone']}','{$data['messageId']}','{$data['group_dr_id']}','{$data['status']}','{$data['content']}','{$times}','{$data['receiveTime']}','{$data['toPhone']}','{$data['uid']}')";
+            $result = $this->getDbEntity()->execute_sql($sql);
+            return $result;
+        }
+
     //根据$messageid 查询牛信云发送日志
     public function select_smslog_new_query($where){
         $sql    = "select * from ly_send_sms_log_new $where LIMIT 1 ";

+ 38 - 0
application/module/ctrl/Send_sms_adminAction.class.php

@@ -330,7 +330,45 @@ class Send_sms_adminAction extends Action
         $this->assign('uname',$uname);
         $this->display('query.html');
     }
+    function didquery(){
+        require_once (ONU_ROOT . "frame/Page.class.php");
+        $admin = new AdvertAdminAction();
+        $where = "where  1=1 ";
+        $page     = $_REQUEST['page']?$_REQUEST['page']:1;
+        $pageSize = 10;
+        $n        = ($page-1)*$pageSize;
+        $pa       = "";//查询参数
+        $limit = " $n,$pageSize";
+        $info           = $_REQUEST['info'];
+        $error			= $_REQUEST['error'];
+        $uname          = $_SESSION['user_infos']['uname'];
+        $list  = $admin->select_smsdidlog_list($where,$limit);
 
+        $all_total = $admin->select_smsdidlog_count($where);
+
+        $p = new Page($all_total,$pageSize,$pa);
+        $pp = $p->fpage();
+        $status_array = array(
+            '1' => '正常',
+            '2' => '禁用',
+        );
+        foreach ($list as $k=>$v){
+            $new[$k]=$v;
+            $new[$k]['uname']=$this->getName($admin,$v['uid']);
+        }
+        $this->assign('status_array',$status_array);
+        $this->assign('info',$info);
+        $this->assign('error',$error);
+        $this->assign('page',$page);
+        $this->assign("show",$pp);
+        $this->assign('list',$new);
+        $this->assign('uname',$uname);
+        $this->display('didquery.html');
+    }
+    public function getName($admin,$uid){
+        $result = $admin->selectUserName($uid);
+        return $result['uname'];
+    }
     function querylists(){
         require_once (ONU_ROOT . "frame/Page.class.php");
         $admin = new AdvertAdminAction();

+ 1 - 0
application/module/view/public/admin_navi.html

@@ -89,6 +89,7 @@
                         <!--<li class="send_email1_left"><a href="/?a=send_email1_admin"><i class="fa fa-angle-double-right"></i> 普通发送</a></li>-->
                         <li class="send_sms_admin"><a href="/?a=send_sms_admin"><i class="fa fa-angle-double-right"></i> 模板发送</a></li>
                         <li class="send_sms_admin"><a href="/?a=send_sms_admin&m=query"><i class="fa fa-angle-double-right"></i>发送记录查询</a></li>
+                        <li class="send_sms_admin"><a href="/?a=send_sms_admin&m=didquery"><i class="fa fa-angle-double-right"></i>客户回执记录查询</a></li>
                     </ul>
                 </li>
                 <li id="treeview6" style="display:none;"  class="treeview">

+ 74 - 0
application/module/view/send_sms_admin/didquery.html

@@ -0,0 +1,74 @@
+<{include file='../public/admin_header.html'}>
+<{include file='../public/admin_navi.html'}>
+<!-- Right side column. Contains the navbar and content of the page -->
+<aside class="right-side">
+	<!-- Content Header (Page header) -->
+	<section class="content-header">
+		<h1>
+			客户回执记录查询
+			<small>Control panel</small>
+		</h1>
+		<ol class="breadcrumb">
+			<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
+			<li class="active">Blank page</li>
+		</ol>
+	</section>
+
+	<!-- Main content -->
+	<section class="content">
+
+		<div class="span9">
+
+
+			<div id='main' class="form-actions">
+
+				<!--<a href="/?a=sms_template_admin&m=add" style="font-weight:bold;text-decoration:underline;">添加短信模板</a>-->
+
+				<div style="height:20px;"></div>
+
+				<table class="table table-striped" style="margin-top:15px;">
+					<tr>
+						<th>ID</th>
+						<th>站点</th>
+						<th>发送人</th>
+						<th>接收人</th>
+						<th >发送内容</th>
+						<th>发送时间</th>
+						<th>状态</th>
+					</tr>
+
+					<{foreach from=$list item=item}>
+					<tr>
+						<td><{$item.log_id}></td>
+						<td><{$item.uname}></td>
+						<td><{$item.from_phone}></td>
+						<td><{$item.did_mobile}></td>
+						<td><{$item.content}></td>
+						<td><{$item.receive_time}></td>
+						<td <{if $item.status==2}>style="color:red;"<{/if}>
+						<{if $item.status==3}>style="color:green;"<{/if}>><{$status_array[$item.status]}></td>
+
+					</tr>
+					<{/foreach}>
+				</table>
+
+				<{$show}>
+
+			</div>
+
+		</div>
+
+	</section><!-- /.content -->
+</aside><!-- /.right-side -->
+</div><!-- ./wrapper -->
+
+<style>
+	select{height:30px;}
+</style>
+<script>
+	$('#treeview11').addClass('active');
+	$(".send_sms_admin").addClass('active');
+</script>
+
+</body>
+</html>