diff --git a/app/admin/controller/mall/redemption/Order.php b/app/admin/controller/mall/redemption/Order.php new file mode 100644 index 0000000..ee737db --- /dev/null +++ b/app/admin/controller/mall/redemption/Order.php @@ -0,0 +1,72 @@ +model = new \app\common\model\MallRedemptionOrder(); + } + + /** + * 查看 + * @throws Throwable + */ + public function index(\Webman\Http\Request $request): \support\Response + { + $response = $this->initializeBackend($request); + if ($response !== null) { + return $response; + } + + if ($request->get('select') || $request->post('select')) { + $this->_select(); + 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) + ->visible(['mallUser' => ['username'], 'mallItem' => ['title']]) + ->alias($alias) + ->where($where) + ->order($order) + ->paginate($limit); + + return $this->success('', [ + 'list' => $res->items(), + 'total' => $res->total(), + 'remark' => get_route_remark(), + ]); + } + + /** + * 若需重写查看、编辑、删除等方法,请复制 @see \app\admin\library\traits\Backend 中对应的方法至此进行重写 + */ +} \ No newline at end of file diff --git a/app/common/model/MallRedemptionOrder.php b/app/common/model/MallRedemptionOrder.php new file mode 100644 index 0000000..d63d528 --- /dev/null +++ b/app/common/model/MallRedemptionOrder.php @@ -0,0 +1,28 @@ +belongsTo(\app\common\model\MallUser::class, 'mall_user_id', 'id'); + } + + public function mallItem(): \think\model\relation\BelongsTo + { + return $this->belongsTo(\app\common\model\MallItem::class, 'mall_item_id', 'id'); + } +} \ No newline at end of file diff --git a/app/common/validate/MallRedemptionOrder.php b/app/common/validate/MallRedemptionOrder.php new file mode 100644 index 0000000..b299cc8 --- /dev/null +++ b/app/common/validate/MallRedemptionOrder.php @@ -0,0 +1,31 @@ + [], + 'edit' => [], + ]; + +} diff --git a/web/src/lang/backend/en/mall/redemptionOrder.ts b/web/src/lang/backend/en/mall/redemptionOrder.ts new file mode 100644 index 0000000..8538ebd --- /dev/null +++ b/web/src/lang/backend/en/mall/redemptionOrder.ts @@ -0,0 +1,20 @@ +export default { + id: 'id', + order: 'order', + mall_user_id: 'mall_user_id', + malluser__username: 'username', + status: 'status', + 'status 0': 'status 0', + 'status 1': 'status 1', + mall_item_id: 'mall_item_id', + mallitem__title: 'title', + address: 'address', + phone: 'phone', + type: 'type', + 'type 1': 'type 1', + 'type 2': 'type 2', + 'type 3': 'type 3', + create_time: 'create_time', + update_time: 'update_time', + 'quick Search Fields': 'id', +} diff --git a/web/src/lang/backend/zh-cn/mall/redemptionOrder.ts b/web/src/lang/backend/zh-cn/mall/redemptionOrder.ts new file mode 100644 index 0000000..666454d --- /dev/null +++ b/web/src/lang/backend/zh-cn/mall/redemptionOrder.ts @@ -0,0 +1,20 @@ +export default { + id: 'ID', + order: '订单号', + mall_user_id: '用户', + malluser__username: '用户名', + status: '状态', + 'status 0': '待发放', + 'status 1': '已发放', + mall_item_id: '商品', + mallitem__title: '标题', + address: '收获地址', + phone: '电话', + type: '类型', + 'type 1': '奖励', + 'type 2': '充值', + 'type 3': '实物', + create_time: '创建时间', + update_time: '修改时间', + 'quick Search Fields': 'ID', +} diff --git a/web/src/views/backend/mall/redemptionOrder/index.vue b/web/src/views/backend/mall/redemptionOrder/index.vue new file mode 100644 index 0000000..de53e3b --- /dev/null +++ b/web/src/views/backend/mall/redemptionOrder/index.vue @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/views/backend/mall/redemptionOrder/popupForm.vue b/web/src/views/backend/mall/redemptionOrder/popupForm.vue new file mode 100644 index 0000000..82f038c --- /dev/null +++ b/web/src/views/backend/mall/redemptionOrder/popupForm.vue @@ -0,0 +1,127 @@ + + + + + + + + {{ baTable.form.operate ? t(baTable.form.operate) : '' }} + + + + + + + + + + + + + + + + + + {{ t('Cancel') }} + + {{ baTable.form.operateIds && baTable.form.operateIds.length > 1 ? t('Save and edit next item') : t('Save') }} + + + + + + + + +