Jonlin 6 年之前
父節點
當前提交
50fb1a9aef
共有 2 個文件被更改,包括 26 次插入18 次删除
  1. 16 9
      application/admin/controller/Messages.php
  2. 10 9
      application/admin/view/messages/index.html

+ 16 - 9
application/admin/controller/Messages.php

@@ -21,15 +21,22 @@ class Messages extends Base
             $where  = [];
             $orwhere  = [];
 
-            //用户账号/昵称
-            if (strlen($param['searchText'])) {
-                if($param['account'] == 'account_name'){
-                    $where['account_name'] = ['like', '%' . $param['searchText'] . '%'];
-                }
-                if($param['account'] == 'nick_name'){
-                    $where['nick_name'] = ['like', '%' . $param['searchText'] . '%'];
-                }
-            }
+//            //用户账号/昵称
+//            if (strlen($param['searchText'])) {
+//                if($param['account'] == 'account_name'){
+//                    $account_id = db('accounts')->where('account_name','like','%'.$param['searchText'].'%')->selest();
+//                    $ids = array();
+//                    for($i=0;$i<count($account_id);$i++){
+//                        $ids[] = $account_id[$i]['id'];
+//                    }
+//                    $where['a.account_id'] = $ids;
+//                    $orwhere['account_id'] = $ids;
+//                }
+//                if($param['account'] == 'nick_name'){
+//                    $where['a.nick_name'] = array('like','%'.$param['searchText'].'%');
+//                    $orwhere['nick_name'] = array('like','%'.$param['searchText'].'%');
+//                }
+//            }
 
             //用户昵称
             if (strlen($param['searchText'])) {

+ 10 - 9
application/admin/view/messages/index.html

@@ -70,16 +70,17 @@
                         {$optiontype}
                         </div>
                     </div>
+                    <!--<div class="form-group" style="margin-left: 10px;">-->
+                        <!--<div class="input-group col-sm-4 layui-form" style="width: 70px;">-->
+                            <!--<input type="hidden" id="account" value="account_name"/>-->
+                            <!--<select lay-verify="required" lay-filter="account">-->
+                                <!--<option value="account_name">账号</option>-->
+                                <!--<option value="nick_name">昵称</option>-->
+                            <!--</select>-->
+                        <!--</div>-->
+                    <!--</div>-->
                     <div class="form-group" style="margin-left: 10px;">
-                        <div class="input-group col-sm-4 layui-form" style="width: 70px;">
-                            <input type="hidden" id="account" value="account_name"/>
-                            <select lay-verify="required" lay-filter="account">
-                                <option value="account_name">账号</option>
-                                <option value="nick_name">昵称</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="form-group">
+                        <label>昵称:</label>
                         <input type="text" class="form-control" id="username" name="user_name" style="width: 100px;height: 30px;">
                     </div>
                     <div class="form-group">