diff --git a/app/admin/controller/mall/PintsOrder.php b/app/admin/controller/mall/PintsOrder.php index 8195f47..a228356 100644 --- a/app/admin/controller/mall/PintsOrder.php +++ b/app/admin/controller/mall/PintsOrder.php @@ -45,14 +45,11 @@ class PintsOrder extends Backend return $this->success(); } - /** - * 1. withJoin 不可使用 alias 方法设置表别名,别名将自动使用关联模型名称(小写下划线命名规则) - * 2. 以下的别名设置了主表别名,同时便于拼接查询参数等 - * 3. paginate 数据集可使用链式操作 each(function($item, $key) {}) 遍历处理 - */ list($where, $alias, $limit, $order) = $this->queryBuilder(); $res = $this->model - ->withJoin($this->withJoinTable, $this->withJoinType) + ->with(['mallUser' => function ($query) { + $query->field('id,username'); + }]) ->visible(['mallUser' => ['username']]) ->alias($alias) ->where($where) diff --git a/app/common/model/MallPintsOrder.php b/app/common/model/MallPintsOrder.php index 925daf8..cd722a9 100644 --- a/app/common/model/MallPintsOrder.php +++ b/app/common/model/MallPintsOrder.php @@ -2,6 +2,7 @@ namespace app\common\model; +use app\common\model\traits\TimestampInteger; use support\think\Model; /** @@ -9,6 +10,8 @@ use support\think\Model; */ class MallPintsOrder extends Model { + use TimestampInteger; + // 表名 protected $name = 'mall_pints_order'; diff --git a/web/src/views/backend/mall/pintsOrder/index.vue b/web/src/views/backend/mall/pintsOrder/index.vue index a57361b..ea992c5 100644 --- a/web/src/views/backend/mall/pintsOrder/index.vue +++ b/web/src/views/backend/mall/pintsOrder/index.vue @@ -59,6 +59,7 @@ const baTable = new baTableClass( label: t('mall.pintsOrder.malluser__username'), prop: 'mallUser.username', align: 'center', + minWidth: 120, operatorPlaceholder: t('Fuzzy query'), render: 'tags', operator: 'LIKE', @@ -68,6 +69,8 @@ const baTable = new baTableClass( label: t('mall.pintsOrder.type'), prop: 'type', align: 'center', + effect: 'dark', + custom: { 1: 'success', 2: 'primary', 3: 'info' }, operator: 'eq', sortable: false, render: 'tag',