Browse Source

fix:后台优化

super-yimizi 1 month ago
parent
commit
5d250e442c

+ 19 - 13
application/admin/controller/shop/Address.php

@@ -8,6 +8,7 @@ use think\Db;
 use think\exception\PDOException;
 use think\exception\PDOException;
 use think\exception\ValidateException;
 use think\exception\ValidateException;
 use app\admin\model\shop\Area;
 use app\admin\model\shop\Area;
+use app\common\Enum\StatusEnum;
 
 
 /**
 /**
  * 收货地址
  * 收货地址
@@ -22,6 +23,7 @@ class Address extends Backend
      * @var \app\admin\model\shop\Address
      * @var \app\admin\model\shop\Address
      */
      */
     protected $model = null;
     protected $model = null;
+    protected $relationSearch = true;
     protected $noNeedRight = ['area'];
     protected $noNeedRight = ['area'];
 
 
     public function _initialize()
     public function _initialize()
@@ -29,6 +31,9 @@ class Address extends Backend
         parent::_initialize();
         parent::_initialize();
         $this->model = new \app\admin\model\shop\Address;
         $this->model = new \app\admin\model\shop\Address;
         $this->view->assign("statusList", $this->model->getStatusList());
         $this->view->assign("statusList", $this->model->getStatusList());
+        $this->assignconfig('statusList', json_encode($this->model->getStatusList()));
+        $this->assignconfig('isdefaultList', json_encode(StatusEnum::getYesNoMap()));
+
     }
     }
 
 
     /**
     /**
@@ -36,6 +41,8 @@ class Address extends Backend
      */
      */
     public function index()
     public function index()
     {
     {
+       
+
         //设置过滤方法
         //设置过滤方法
         $this->request->filter(['strip_tags', 'trim']);
         $this->request->filter(['strip_tags', 'trim']);
         if ($this->request->isAjax()) {
         if ($this->request->isAjax()) {
@@ -44,20 +51,19 @@ class Address extends Backend
                 return $this->selectpage();
                 return $this->selectpage();
             }
             }
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
+            $total = $this->model
+                    ->with(['user', 'province', 'city', 'area'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->count();
             $list = $this->model
             $list = $this->model
-                ->with(['User', 'Province', 'City', 'Area'])
-                ->where($where)
-                ->order($sort, $order)
-                ->paginate($limit);
-
-            foreach ($list as $index => $item) {
-                if ($item->user) {
-                    $item->user->visible(['id', 'nickname', 'avatar']);
-                }
-            }
-
-            $result = array("total" => $list->total(), "rows" => $list->items());
+                    ->with(['user', 'province', 'city', 'area'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->limit($offset, $limit)
+                    ->select();
+            $result = array("total" => $total, "rows" => $list);
+         
 
 
             return json($result);
             return json($result);
         }
         }

+ 5 - 5
application/admin/controller/shop/Collect.php

@@ -16,8 +16,9 @@ class Collect extends Backend
      * Collect模型对象
      * Collect模型对象
      * @var \app\admin\model\shop\Collect
      * @var \app\admin\model\shop\Collect
      */
      */
-    protected $model = null;
-
+    protected $model = null; 
+    protected $relationSearch = true;
+    protected $searchFields = 'id';
     public function _initialize()
     public function _initialize()
     {
     {
         parent::_initialize();
         parent::_initialize();
@@ -38,16 +39,15 @@ class Collect extends Backend
                 return $this->selectpage();
                 return $this->selectpage();
             }
             }
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-
             $list = $this->model
             $list = $this->model
-                ->with(['User', 'Goods'])
+                ->with(['user', 'goods'])
                 ->where($where)
                 ->where($where)
                 ->order($sort, $order)
                 ->order($sort, $order)
                 ->paginate($limit);
                 ->paginate($limit);
 
 
             foreach ($list as $index => $item) {
             foreach ($list as $index => $item) {
                 if ($item->user) {
                 if ($item->user) {
-                    $item->user->visible(['id', 'nickname', 'avatar']);
+                    $item->user->visible(['id', 'nickname', 'avatar','username']);
                 }
                 }
             }
             }
 
 

+ 0 - 2
application/admin/controller/shop/Order.php

@@ -132,8 +132,6 @@ class Order extends Backend
 
 
             return json($result);
             return json($result);
         }
         }
-        $config = get_addon_config('shop');
-        $this->assignconfig('shop', $config);
         return $this->view->fetch();
         return $this->view->fetch();
     }
     }
 
 

+ 2 - 1
application/admin/lang/zh-cn/shop/address.php

@@ -1,8 +1,9 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'          => '号',
+    'Id'          => '号',
     'User_id'     => '用户ID',
     'User_id'     => '用户ID',
+    'User'     => '用户信息',
     'Province_id' => '省id',
     'Province_id' => '省id',
     'Province'    => '省',
     'Province'    => '省',
     'City_id'     => '市id',
     'City_id'     => '市id',

+ 1 - 1
application/admin/lang/zh-cn/shop/brand.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'         => 'id',
+    'Id'         => '编号',
     'Name'       => '名称',
     'Name'       => '名称',
     'Image'      => '图片',
     'Image'      => '图片',
     'Createtime' => '创建时间',
     'Createtime' => '创建时间',

+ 1 - 1
application/admin/lang/zh-cn/shop/card.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'          => 'ID',
+    'Id'          => '编号',
     'Content'     => '内容',
     'Content'     => '内容',
     'Title'       => '标题',
     'Title'       => '标题',
     'Preview'     => '微预览',
     'Preview'     => '微预览',

+ 1 - 1
application/admin/lang/zh-cn/shop/category.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Pid'         => '父ID',
+    'Pid'         => '父',
     'Image'       => '图片',
     'Image'       => '图片',
     'Isnav'       => '导航',
     'Isnav'       => '导航',
     'Keywords'    => '关键字',
     'Keywords'    => '关键字',

+ 3 - 2
application/admin/lang/zh-cn/shop/collect.php

@@ -1,8 +1,9 @@
 <?php
 <?php
 
 
 return [
 return [
-    'User_id'    => '用户id',
-    'User'       => '用户',
+    'Id'         => '序号',
+    'User_id'    => '用户信息',
+    'User'       => '用户信息',
     'Goods_id'   => '商品id',
     'Goods_id'   => '商品id',
     'Goods'      => '商品',
     'Goods'      => '商品',
     'Status'     => '状态',
     'Status'     => '状态',

+ 1 - 1
application/admin/lang/zh-cn/shop/comment.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'         => 'ID',
+    'Id'         => '序号',
     'Pid'        => '父评论ID',
     'Pid'        => '父评论ID',
     'User_id'    => '会员ID',
     'User_id'    => '会员ID',
     'User'       => '会员',
     'User'       => '会员',

+ 1 - 1
application/admin/lang/zh-cn/shop/electronics_order.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'                    => 'ID',
+    'Id'                    => '序号',
     'Shipper_id'            => '快递公司ID',
     'Shipper_id'            => '快递公司ID',
     'Shipper'               => '快递公司',
     'Shipper'               => '快递公司',
     'Paytype'               => '运费支付方式',
     'Paytype'               => '运费支付方式',

+ 1 - 1
application/admin/lang/zh-cn/shop/goods.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 
 
 return [
 return [
-    'Id'                              => '商品ID',
+    'Id'                              => '商品序号',
     'Type'                            => '商品类型',
     'Type'                            => '商品类型',
     'Category_id'                     => '类别ID',
     'Category_id'                     => '类别ID',
     'Category_ids'                    => '商品分类',
     'Category_ids'                    => '商品分类',

+ 10 - 10
application/admin/model/shop/Address.php

@@ -4,7 +4,7 @@ namespace app\admin\model\shop;
 
 
 use think\Model;
 use think\Model;
 use traits\model\SoftDelete;
 use traits\model\SoftDelete;
-
+use app\common\Enum\StatusEnum;
 
 
 class Address extends Model
 class Address extends Model
 {
 {
@@ -43,7 +43,7 @@ class Address extends Model
 
 
     public function getStatusList()
     public function getStatusList()
     {
     {
-        return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
+        return StatusEnum::getMap();
     }
     }
 
 
 
 
@@ -54,23 +54,23 @@ class Address extends Model
         return $list[$value] ?? '';
         return $list[$value] ?? '';
     }
     }
 
 
-    public function User()
+    public function user()
     {
     {
-        return $this->hasOne('\\app\\common\\model\\User', 'id', 'user_id', [], 'LEFT');
+        return $this->hasOne('\\app\\common\\model\\User', 'id', 'user_id', [], 'LEFT')->setEagerlyType(0);
     }
     }
 
 
-    public function Province()
+    public function province()
     {
     {
-        return $this->hasOne('Area', 'id', 'province_id', [], 'LEFT');
+        return $this->hasOne('Area', 'id', 'province_id', [], 'LEFT')->setEagerlyType(0);
     }
     }
 
 
-    public function City()
+    public function city()
     {
     {
-        return $this->hasOne('Area', 'id', 'city_id', [], 'LEFT');
+        return $this->hasOne('Area', 'id', 'city_id', [], 'LEFT')->setEagerlyType(0);
     }
     }
 
 
-    public function Area()
+    public function area()
     {
     {
-        return $this->hasOne('Area', 'id', 'area_id', [], 'LEFT');
+        return $this->hasOne('Area', 'id', 'area_id', [], 'LEFT')->setEagerlyType(0);
     }
     }
 }
 }

+ 6 - 6
application/admin/model/shop/Collect.php

@@ -3,7 +3,7 @@
 namespace app\admin\model\shop;
 namespace app\admin\model\shop;
 
 
 use think\Model;
 use think\Model;
-
+use app\common\Enum\StatusEnum;
 
 
 class Collect extends Model
 class Collect extends Model
 {
 {
@@ -28,7 +28,7 @@ class Collect extends Model
 
 
     public function getStatusList()
     public function getStatusList()
     {
     {
-        return ['0' => __('Status 0'), '1' => __('Status 1')];
+        return StatusEnum::getMap();
     }
     }
 
 
 
 
@@ -39,13 +39,13 @@ class Collect extends Model
         return $list[$value] ?? '';
         return $list[$value] ?? '';
     }
     }
 
 
-    public function User()
+    public function user()
     {
     {
-        return $this->hasOne('\\app\\common\\model\\User', 'id', 'user_id', [], 'LEFT');
+        return $this->hasOne('\\app\\common\\model\\User', 'id', 'user_id',[], 'LEFT')->setEagerlyType(0);
     }
     }
 
 
-    public function Goods()
+    public function goods()
     {
     {
-        return $this->hasOne('Goods', 'id', 'goods_id', [], 'LEFT');
+        return $this->hasOne('Goods', 'id', 'goods_id',[], 'LEFT')->setEagerlyType(0);
     }
     }
 }
 }

+ 2 - 2
application/admin/validate/User.php

@@ -11,9 +11,9 @@ class User extends Validate
      */
      */
     protected $rule = [
     protected $rule = [
         'username' => 'require|regex:\w{3,30}|unique:user',
         'username' => 'require|regex:\w{3,30}|unique:user',
-        'nickname' => 'require|unique:user',
+        'nickname' => 'unique:user',
         'password' => 'regex:\S{6,30}',
         'password' => 'regex:\S{6,30}',
-        'email'    => 'require|email|unique:user',
+        'email'    => 'email|unique:user',
         'mobile'   => 'unique:user'
         'mobile'   => 'unique:user'
     ];
     ];
 
 

+ 3 - 3
application/admin/view/shop/address/edit.html

@@ -50,15 +50,15 @@
     <div class="form-group">
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Usednums')}:</label>
         <label class="control-label col-xs-12 col-sm-2">{:__('Usednums')}:</label>
         <div class="col-xs-12 col-sm-8">
         <div class="col-xs-12 col-sm-8">
-            <input id="c-usednums" class="form-control" name="row[usednums]" type="number" value="{$row.usednums|htmlentities}">
+            <input id="c-usednums" class="form-control" name="row[used_nums]" type="number" value="{$row.used_nums|htmlentities}">
         </div>
         </div>
     </div>
     </div>
     <div class="form-group">
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Isdefault')}:</label>
         <label class="control-label col-xs-12 col-sm-2">{:__('Isdefault')}:</label>
         <div class="col-xs-12 col-sm-8">
         <div class="col-xs-12 col-sm-8">
-            <input  id="c-isdefault" name="row[isdefault]" type="hidden" value="{$row.isdefault|htmlentities}">
+            <input  id="c-isdefault" name="row[is_default]" type="hidden" value="{$row.is_default|htmlentities}">
             <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isdefault" data-yes="1" data-no="0" >
             <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-isdefault" data-yes="1" data-no="0" >
-                <i class="fa fa-toggle-on text-success {eq name="$row.isdefault" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
+                <i class="fa fa-toggle-on text-success {eq name="$row.is_default" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
             </a>
             </a>
         </div>
         </div>
     </div>
     </div>

+ 7 - 2
application/admin/view/shop/address/index.html

@@ -1,5 +1,10 @@
 <div class="panel panel-default panel-intro">
 <div class="panel panel-default panel-intro">
-    {:build_heading()}
+   
+    <div class="panel-heading">
+        <div class="panel-lead"><em>用户地址</em>用于用户地址信息查看、修改</div>
+        {:build_heading(null,FALSE)}
+    </div>
+
 
 
     <div class="panel-body">
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
         <div id="myTabContent" class="tab-content">
@@ -8,7 +13,7 @@
                     <div id="toolbar" class="toolbar">
                     <div id="toolbar" class="toolbar">
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                         <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('shop/address/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
                         <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('shop/address/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
-                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('shop/address/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <!-- <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('shop/address/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> -->
                         <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('shop/address/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                         <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('shop/address/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
 
 
                         <div class="dropdown btn-group {:$auth->check('shop/address/multi')?'':'hide'}">
                         <div class="dropdown btn-group {:$auth->check('shop/address/multi')?'':'hide'}">

+ 1 - 0
application/admin/view/shop/collect/index.html

@@ -1,6 +1,7 @@
 <div class="panel panel-default panel-intro">
 <div class="panel panel-default panel-intro">
 
 
     <div class="panel-heading">
     <div class="panel-heading">
+        <div class="panel-lead"><em>用户收藏管理</em>用于用户收藏信息查看、修改</div>
         {:build_heading(null,FALSE)}
         {:build_heading(null,FALSE)}
         <ul class="nav nav-tabs" data-field="status">
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>

+ 1 - 0
application/admin/view/user/share/index.html

@@ -1,4 +1,5 @@
 <div class="panel panel-default panel-intro">
 <div class="panel panel-default panel-intro">
+    <div class="panel-lead"><em>分享记录</em>用于用户分享记录查看</div>
     {:build_heading()}
     {:build_heading()}
 
 
     <div class="panel-body">
     <div class="panel-body">

+ 20 - 17
application/admin/view/user/user/edit.html

@@ -11,12 +11,12 @@
             <div class="row">
             <div class="row">
                 <!-- 左列 -->
                 <!-- 左列 -->
                 <div class="col-md-6">
                 <div class="col-md-6">
-                    <div class="form-group">
+                    <!-- <div class="form-group">
                         <label class="control-label col-xs-12 col-sm-4">{:__('Group')}:</label>
                         <label class="control-label col-xs-12 col-sm-4">{:__('Group')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
                             {$groupList}
                             {$groupList}
                         </div>
                         </div>
-                    </div>
+                    </div> -->
                     <div class="form-group">
                     <div class="form-group">
                         <label for="c-username" class="control-label col-xs-12 col-sm-4">{:__('Username')}:</label>
                         <label for="c-username" class="control-label col-xs-12 col-sm-4">{:__('Username')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
@@ -35,12 +35,12 @@
                             <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password" value="" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" />
                             <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password" value="" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" />
                         </div>
                         </div>
                     </div>
                     </div>
-                    <div class="form-group">
+                    <!-- <div class="form-group">
                         <label for="c-email" class="control-label col-xs-12 col-sm-4">{:__('Email')}:</label>
                         <label for="c-email" class="control-label col-xs-12 col-sm-4">{:__('Email')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
                             <input id="c-email" data-rule="email" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
                             <input id="c-email" data-rule="email" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
                         </div>
                         </div>
-                    </div>
+                    </div> -->
                     <div class="form-group">
                     <div class="form-group">
                         <label for="c-mobile" class="control-label col-xs-12 col-sm-4">{:__('Mobile')}:</label>
                         <label for="c-mobile" class="control-label col-xs-12 col-sm-4">{:__('Mobile')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
@@ -76,18 +76,6 @@
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="form-group">
                     <div class="form-group">
-                        <label for="c-successions" class="control-label col-xs-12 col-sm-4">{:__('Successions')}:</label>
-                        <div class="col-xs-12 col-sm-8">
-                            <input id="c-successions" data-rule="required" class="form-control" name="row[successions]" type="number" value="{$row.successions|htmlentities}">
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label for="c-maxsuccessions" class="control-label col-xs-12 col-sm-4">{:__('Maxsuccessions')}:</label>
-                        <div class="col-xs-12 col-sm-8">
-                            <input id="c-maxsuccessions" data-rule="required" class="form-control" name="row[maxsuccessions]" type="number" value="{$row.maxsuccessions|htmlentities}">
-                        </div>
-                    </div>
-                    <div class="form-group">
                         <label class="control-label col-xs-12 col-sm-4">{:__('Status')}:</label>
                         <label class="control-label col-xs-12 col-sm-4">{:__('Status')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
                             <div class="radio">
                             <div class="radio">
@@ -151,11 +139,26 @@
                             <p class="form-control-static text-muted">{$row.loginip|htmlentities}</p>
                             <p class="form-control-static text-muted">{$row.loginip|htmlentities}</p>
                         </div>
                         </div>
                     </div>
                     </div>
+                    <div class="form-group">
+                        <label for="c-successions" class="control-label col-xs-12 col-sm-4">{:__('Successions')}:</label>
+                        <div class="col-xs-12 col-sm-8">                            
+                            <p class="form-control-static text-muted">{$row.successions|htmlentities}</p>
+                        </div>
+                    </div>
                 </div>
                 </div>
-                
+              
+               
                 <!-- 右列 -->
                 <!-- 右列 -->
+              
+                
                 <div class="col-md-6">
                 <div class="col-md-6">
                     <div class="form-group">
                     <div class="form-group">
+                        <label for="c-maxsuccessions" class="control-label col-xs-12 col-sm-4">{:__('Maxsuccessions')}:</label>
+                        <div class="col-xs-12 col-sm-8">
+                            <p class="form-control-static text-muted">{$row.maxsuccessions|htmlentities}</p>
+                        </div>
+                    </div>
+                    <div class="form-group">
                         <label class="control-label col-xs-12 col-sm-4">{:__('Loginfailure')}:</label>
                         <label class="control-label col-xs-12 col-sm-4">{:__('Loginfailure')}:</label>
                         <div class="col-xs-12 col-sm-8">
                         <div class="col-xs-12 col-sm-8">
                             <p class="form-control-static text-muted">{$row.loginfailure|htmlentities}</p>
                             <p class="form-control-static text-muted">{$row.loginfailure|htmlentities}</p>

+ 5 - 3
application/admin/view/user/user/index.html

@@ -1,6 +1,8 @@
-<div class="panel panel-default panel-intro">
-    {:build_heading()}
-
+<div class="panel panel-default panel-intro"> 
+    <div class="panel-heading">
+        <div class="panel-lead"><em>用户管理</em>用于用户信息查看、修改</div>
+        {:build_heading(null,FALSE)}
+    </div>
     <div class="panel-body">
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">
         <div id="myTabContent" class="tab-content">
             <div class="tab-pane fade active in" id="one">
             <div class="tab-pane fade active in" id="one">

+ 50 - 6
public/assets/js/backend/shop/address.js

@@ -26,20 +26,49 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                     [
                         {checkbox: true},
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'id', title: __('Id')},
-                        {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search},
-                        {field: 'user.nickname', title: __('Nickname')},
+                        {
+                            field: 'user.username',
+                            title: __('User'),
+                            operate: 'LIKE',
+                            formatter: function (value, row, index) {
+                                // 显示用户头像和用户名
+                                var avatar = row.user && row.user.avatar ? row.user.avatar : '/assets/img/avatar.png';
+                                var username = row.user && row.user.username ? row.user.username : '游客';
+                                var userId = row.user_id || '';
+                                
+                                // 处理头像URL
+                                var avatarUrl = avatar;
+                                if (avatar && !avatar.startsWith('http') && !avatar.startsWith('//')) {
+                                    avatarUrl = Fast.api.cdnurl ? Fast.api.cdnurl(avatar) : avatar;
+                                }
+                                
+                                return '<div style="display:flex;align-items:center;">' + 
+                                       '<img src="' + avatarUrl + '" style="width:40px;height:40px;border-radius:50%;margin-right:10px;" />' +
+                                       '<div>' +
+                                       '<div style="color:#337ab7;font-weight:bold;">' + username + '</div>' +
+                                       '<div style="color:#999;font-size:12px;">ID: ' + userId + '</div>' +
+                                       '</div>' +
+                                       '</div>';
+                            }
+                        },
                         {field: 'province.name', title: __('Province')},
                         {field: 'province.name', title: __('Province')},
                         {field: 'city.name', title: __('City')},
                         {field: 'city.name', title: __('City')},
                         {field: 'area.name', title: __('Area')},
                         {field: 'area.name', title: __('Area')},
                         {field: 'receiver', title: __('Receiver'), operate: 'LIKE'},
                         {field: 'receiver', title: __('Receiver'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                         {field: 'address', title: __('Address'), operate: 'LIKE'},
                         {field: 'address', title: __('Address'), operate: 'LIKE'},
-                        {field: 'zipcode', title: __('Zipcode'), operate: 'LIKE', visible: false},
-                        {field: 'usednums', title: __('Usednums')},
+                        // {field: 'zipcode', title: __('Zipcode'), operate: 'LIKE', visible: false},
+                        {field: 'used_nums', title: __('Usednums')},
                         {field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
                         {field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
-                        {field: 'isdefault', title: __('Isdefault'), searchList: {"1": __('Yes'), "0": __('No')}, table: table, formatter: Table.api.formatter.toggle},
-                        {field: 'status', title: __('Status'), operate: 'LIKE', formatter: Table.api.formatter.status},
+                        {
+                            field: 'is_default',
+                             title: __('Isdefault'), 
+                             searchList: Controller.api.parseConfigJson('isdefaultList'), 
+                             table: table, 
+                             formatter: Table.api.formatter.toggle
+                        },
+                        {field: 'status', title: __('Status'), searchList: Controller.api.parseConfigJson('statusList'), formatter: Table.api.formatter.status},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                     ]
                 ]
                 ]
@@ -115,6 +144,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Controller.api.bindevent();
             Controller.api.bindevent();
         },
         },
         api: {
         api: {
+            // 解析Config中的JSON字符串的辅助函数
+            parseConfigJson: function(configKey, defaultValue) {
+                var configValue = Config[configKey] || defaultValue || {};
+                
+                // 如果是字符串,尝试解析JSON
+                if (typeof configValue === 'string') {
+                    try {
+                        return JSON.parse(configValue);
+                    } catch (e) {
+                        return defaultValue || {};
+                    }
+                }
+                
+                return configValue;
+            },
             bindevent: function () {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));
                 Form.api.bindevent($("form[role=form]"));
             }
             }

+ 26 - 2
public/assets/js/backend/shop/collect.js

@@ -26,8 +26,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                     [
                         {checkbox: true},
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'id', title: __('Id')},
-                        {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search},
-                        {field: 'user.nickname', title: __('Nickname')},
+                        // {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search},
+                        {
+                            field: 'user.username',
+                            title: __('User'),
+                            operate: 'LIKE',
+                            formatter: function (value, row, index) {
+                                // 显示用户头像和用户名
+                                var avatar = row.user && row.user.avatar ? row.user.avatar : '/assets/img/avatar.png';
+                                var username = row.user && row.user.username ? row.user.username : '游客';
+                                var userId = row.user_id || '';
+                                
+                                // 处理头像URL
+                                var avatarUrl = avatar;
+                                if (avatar && !avatar.startsWith('http') && !avatar.startsWith('//')) {
+                                    avatarUrl = Fast.api.cdnurl ? Fast.api.cdnurl(avatar) : avatar;
+                                }
+                                
+                                return '<div style="display:flex;align-items:center;">' + 
+                                       '<img src="' + avatarUrl + '" style="width:40px;height:40px;border-radius:50%;margin-right:10px;" />' +
+                                       '<div>' +
+                                       '<div style="color:#337ab7;font-weight:bold;">' + username + '</div>' +
+                                       '<div style="color:#999;font-size:12px;">ID: ' + userId + '</div>' +
+                                       '</div>' +
+                                       '</div>';
+                            }
+                        },
                         {field: 'goods.title', title: __('Goods')},
                         {field: 'goods.title', title: __('Goods')},
                         {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
                         {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

+ 3 - 3
public/assets/js/backend/shop/report.js

@@ -17,9 +17,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t
             });
             });
 
 
             //每隔60s定时刷新图表
             //每隔60s定时刷新图表
-            setInterval(function () {
-                $(".btn-refresh").trigger("click");
-            }, 60000);
+            // setInterval(function () {
+            //     $(".btn-refresh").trigger("click");
+            // }, 60000);
 
 
             //点击按钮
             //点击按钮
             $(document).on("click", ".btn-filter", function () {
             $(document).on("click", ".btn-filter", function () {

+ 2 - 2
public/assets/js/backend/user/user.js

@@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                     [
                         {checkbox: true},
                         {checkbox: true},
                         {field: 'id', title: __('Id'), sortable: true},
                         {field: 'id', title: __('Id'), sortable: true},
-                        {field: 'group.name', title: __('Group')},
+                        // {field: 'group.name', title: __('Group')},
                         // {field: 'username', title: __('Username'), operate: 'LIKE'},
                         // {field: 'username', title: __('Username'), operate: 'LIKE'},
                         {
                         {
                             field: 'user.username', 
                             field: 'user.username', 
@@ -55,7 +55,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             }
                             }
                         },
                         },
                         // {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
                         // {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
-                        {field: 'email', title: __('Email'), operate: 'LIKE'},
+                        // {field: 'email', title: __('Email'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                         // {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
                         // {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
                        //{field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
                        //{field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},