shq1016 преди 6 години
родител
ревизия
f73b11e785

+ 82 - 1
app/admin/controller/MessageController.php

@@ -82,6 +82,9 @@ class MessageController extends AdminBaseController{
                         ->order('p1.create_time','asc')
                         ->field($field)->where('p1.catid','in',$cates)->where($map2)->limit(0,$from)->select();
 
+                    $lists=$this->covermobile($lists,$this->returnmobile());
+
+
                 }else{
 
                     $field=['*'];
@@ -101,6 +104,71 @@ class MessageController extends AdminBaseController{
     }
 
 
+
+    //已经查看的手机号
+    public function returnmobile()
+    {
+        $map  = array();
+        $username = $_SESSION['think']['name'];
+        $userinfo = Db::name('user')->where('user_login',$username)->find();
+        $userid = $userinfo['id'];
+        //分配的信息id
+        $fenpei  = Db::name('user_fp')->where('userid',$userid)->find();
+
+        $data=array();
+        if(!empty($fenpei))
+        {
+            $cates = $fenpei['cates'];
+            $from = $fenpei['tiaoshu'];
+            $map[] = ['create_time','>',$fenpei['from_time']];
+            if($fenpei['enable']==1){
+                $map2[] = ['p1.create_time','>',$fenpei['from_time']];
+                $field=['p1.*','FROM_UNIXTIME(p1.create_time)'=>'create_time' ];
+                $data = Db::name('message')
+                    ->alias('p1')
+                    ->leftJoin('mobile_log p2','p1.`id`=p2.`msg_id`')
+                    ->field($field)->where('p1.catid','in',$cates)->where($map2)->where('p2.user_id',$userid)->limit(0,$from)->select();
+
+
+            }
+
+        }
+
+
+        return $data;
+
+
+
+    }
+
+    private function covermobile($lists,$data)
+    {
+        $j=0;
+        $re_list=array();
+        foreach ($lists as $val)
+        {
+            $re_list[$j]=$val;
+            foreach ($data as $arr)
+            {
+
+               if($val['id']==$arr['id'])
+               {
+                   $re_list[$j]['mobile']=$arr['mobile'];
+               }
+
+            }
+            $j++;
+
+        }
+
+        return $re_list;
+
+    }
+
+
+
+
+
     //把二维数组反转
     public function array_fan($arr)
     {
@@ -145,6 +213,13 @@ class MessageController extends AdminBaseController{
         $bol=0;
         if(!empty($fenpei))
         {
+            //判断是否超过3次
+            $msg_id=$param['id'];
+            $msg=Db::name('mobile_log')->where('msg_id',$msg_id)->count();
+            if($msg>2){
+                $this->error('该条信息已经被人查看');
+            }
+
                 $cates = $fenpei['cates'];
                 $from = $fenpei['tiaoshu'];
                 $map[] = ['create_time','>',$fenpei['from_time']];
@@ -316,6 +391,12 @@ class MessageController extends AdminBaseController{
         }else{
             $this->error('手机号码不正确');
         }
+        if(empty($param['catname']))
+        {
+            $this->error('分类不能为空');
+
+        }
+
 
             // ppppppppp
         if($param['catname']){
@@ -325,7 +406,7 @@ class MessageController extends AdminBaseController{
                 $param['catid']=$cat['id'];
 
             }else{
-               $this->error('添加失败'); 
+               $this->error('添加失败,没有该分类');
             }
 
 

+ 11 - 9
public/themes/admin_simpleboot3/admin/message/index.html

@@ -45,17 +45,18 @@
             <thead>
             <tr>
                 <?php if($qx){ ?>
-                <th width="40"><input type="checkbox"  onclick="checkall(this.form);"></th>
-                <?php }else{ ?>
+<!--                <th width="40"><input type="checkbox"  onclick="checkall(this.form);"></th>-->
+                <?php } ?>
                 <th width="40">序号</th>
-                <?php }?>
+
                 <th width="150">品牌</th>
                 <th width="130">新闻</th>
                 <th width="70">分类</th>
                 <!--<th width="120">新闻</th>-->
                 <th width="100">姓名</th>
                 <th width="80">IP</th>
-                <th width="100">所在区域</th>
+
+<!--                <th width="100">所在区域</th>-->
                 <th width="80">投资额度</th>
                 <th width="180">电话</th>
                 <!-- <th width="80">回访时间</th> -->
@@ -71,10 +72,10 @@
             <foreach name="lists" item="vo">
                 <tr>
                     <?php if($qx){ ?>
-                    <td><input type="checkbox" name="msg[]"  value="{$vo.id}"></td>
-                    <?php }else{ ?>
+<!--                    <td><input type="checkbox" name="msg[]"  value="{$vo.id}"></td>-->
+                    <?php } ?>
                     <td width="40"><?php echo $i=$i+1; ?></td>
-                    <?php }?>
+
                     <td><a target="_blank" href="/b{$vo.jm_id}">{$vo.jm_title}</a></td>
                     <?php if($vo['news_id']>0){ ?>
                     	<td><a target="_blank" href="/news{$vo.news_id}">{$vo.news_kw} </td>
@@ -86,11 +87,12 @@
                 	
                     <td>{$vo.name}</td>
                     <td>{$vo.ip}</td>
-                    <td>{$vo.area}</td>
+<!--                    <td>{$vo.area}</td>-->
                     <td>{$vo.tzed}</td>
                     <td id="m{$vo.id}" >{$vo.mobile}
-                        <?php if(!$qx){ ?>
+                        <?php if(!$qx and !is_numeric($vo['mobile']) ){ ?>
                         <if condition="$fenpei.enable==1">
+
                         <a class="mobile"  data="{$vo.id}" href="javascript:;" > 查看</a>
                         <span class="label label-success" title="已被查看{$vo.vid}次">{$vo.vid}</span>
                         </if>

+ 3 - 3
public/themes/admin_simpleboot3/admin/message/shanghu.html

@@ -23,7 +23,7 @@
                 <th width="150">商户名</th>
                 <th>已分配分类</th>
                 <th width="200">开始时间</th>
-             
+                <th width="200">结束时间</th>
                 <th width="200">分配时间</th>
                 <th width="120">操作</th>
             </tr>
@@ -48,10 +48,10 @@
                         ?>
                     </td>
                     <td><if condition="$vo['from_time']">{:date('Y-m-d H:i:s',$vo['from_time'])}</if></td>
-                  
+                    <td><if condition="$vo['from_time']">{:date('Y-m-d H:i:s',$vo['end_time'])}</if></td>
                     
                     <td><if condition="$vo['from_time']">{:date('Y-m-d H:i:s',$vo['create_time'])}</if></td>
-                    
+
                     <td>
                         <a class="btn btn-xs btn-primary" href='{:url("Message/shanghuEdit",array("userid"=>$vo["shid"]))}'>分配调整</a>
                     </td>

+ 6 - 6
public/themes/admin_simpleboot3/admin/message/shanghu_edit.html

@@ -33,12 +33,12 @@
                     <input class="js-datetime" type="text" id="from_time" name="from_time" <?php if($ypz){ ?> value="{:date('Y-m-d H:i:s',$info['from_time'])}" <?php } ?>>
                 </div>
         </div>
-        <!--<div class="form-group">-->
-        <!--        <label for="end_time" class="col-sm-2 control-label">结束时间</label>-->
-        <!--        <div class="col-md-6 col-sm-10">-->
-        <!--                <input class="js-datetime" type="text" id="end_time" name="end_time" <?php if($ypz){ ?> value="{:date('Y-m-d H:i:s',$info['end_time'])}" <?php } ?> >-->
-        <!--        </div>-->
-        <!--</div>-->
+        <div class="form-group">
+                <label for="end_time" class="col-sm-2 control-label">结束时间</label>
+                <div class="col-md-6 col-sm-10">
+                        <input class="js-datetime" type="text" id="end_time" name="end_time" <?php if($ypz){ ?> value="{:date('Y-m-d H:i:s',$info['end_time'])}" <?php } ?> >
+                </div>
+        </div>
         <div class="form-group">
             <label for="input-user_tiaoshu" class="col-sm-2 control-label">可以查看的条数</label>
             <div class="col-md-6 col-sm-10">