From 9792cebe062ab1b66962ac2899bb78bebacff0a4 Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Sun, 17 Mar 2024 11:11:23 +0800 Subject: [PATCH 1/2] 1 --- application/api/controller/Warehouse.php | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 application/api/controller/Warehouse.php diff --git a/application/api/controller/Warehouse.php b/application/api/controller/Warehouse.php new file mode 100644 index 0000000..bc69a63 --- /dev/null +++ b/application/api/controller/Warehouse.php @@ -0,0 +1,28 @@ +model = new warehouseModel(); + } + /** + * 仓库列表 + * @return + */ + public function list() { + $list = $this->model->paginate(10); + $this->success('success', $list); + } +} \ No newline at end of file From 98f7a052960df9a10e0d438897b5f20456a005dd Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Sun, 17 Mar 2024 22:44:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=92=8C=E5=95=86=E5=93=81=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/shopro/controller/Category.php | 1 + application/admin/controller/ScoreLog.php | 37 +++++++++ application/admin/controller/Warehouse.php | 4 + .../admin/controller/shopro/goods/Goods.php | 3 +- application/admin/lang/zh-cn/score_log.php | 26 ++++++ application/admin/model/ScoreLog.php | 40 +++++++++ .../admin/model/shopro/goods/Goods.php | 10 +++ application/admin/validate/ScoreLog.php | 27 ++++++ application/admin/view/score_log/add.html | 69 ++++++++++++++++ application/admin/view/score_log/edit.html | 69 ++++++++++++++++ application/admin/view/score_log/index.html | 29 +++++++ .../admin/view/shopro/category/add.html | 48 +++++------ .../admin/view/shopro/goods/goods/add.html | 82 ++++++++++++++----- .../admin/view/shopro/user/user/detail.html | 6 +- public/assets/js/backend/score_log.js | 63 ++++++++++++++ .../assets/js/backend/shopro/goods/goods.js | 35 ++++++-- 16 files changed, 493 insertions(+), 56 deletions(-) create mode 100644 application/admin/controller/ScoreLog.php create mode 100644 application/admin/lang/zh-cn/score_log.php create mode 100644 application/admin/model/ScoreLog.php create mode 100644 application/admin/validate/ScoreLog.php create mode 100644 application/admin/view/score_log/add.html create mode 100644 application/admin/view/score_log/edit.html create mode 100644 application/admin/view/score_log/index.html create mode 100644 public/assets/js/backend/score_log.js diff --git a/addons/shopro/controller/Category.php b/addons/shopro/controller/Category.php index 677d6e9..753441c 100755 --- a/addons/shopro/controller/Category.php +++ b/addons/shopro/controller/Category.php @@ -49,6 +49,7 @@ class Category extends Common foreach ($row['goods_list'] as $v) { $v->image = formatImage($v->image); $v->images = array_map('formatImage', $v->images); + $v->back_score = 40; } } $this->success('商城分类', $category); diff --git a/application/admin/controller/ScoreLog.php b/application/admin/controller/ScoreLog.php new file mode 100644 index 0000000..60af61f --- /dev/null +++ b/application/admin/controller/ScoreLog.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\ScoreLog; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/Warehouse.php b/application/admin/controller/Warehouse.php index 3c3d2a8..318559c 100644 --- a/application/admin/controller/Warehouse.php +++ b/application/admin/controller/Warehouse.php @@ -33,5 +33,9 @@ class Warehouse extends Backend * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 */ + public function getList() { + $data= $this->model->field('id, name')->select(); + $this->success('仓库地址列表', null, $data); + } } diff --git a/application/admin/controller/shopro/goods/Goods.php b/application/admin/controller/shopro/goods/Goods.php index cada607..d9e603f 100755 --- a/application/admin/controller/shopro/goods/Goods.php +++ b/application/admin/controller/shopro/goods/Goods.php @@ -183,7 +183,8 @@ class Goods extends Common $params = $this->request->only([ 'type', 'title', 'subtitle', 'image', 'images', 'image_wh', 'params', 'original_price', 'price', 'is_sku', 'limit_type', 'limit_num', 'sales_show_type', - 'stock_show_type', 'show_sales', 'service_ids', 'dispatch_type', 'dispatch_id', 'is_offline', 'status', 'weigh', + 'stock_show_type', 'show_sales', 'service_ids','dispatch_type', 'dispatch_id', 'is_offline', 'status', 'weigh', + 'user_price', 'level1_price', 'level2_price', 'level3_price', 'company_price', 'is_new_user', 'warehouse_ids' ]); // likes, views, sales, $this->request->has('content') && $params['content'] = $this->request->param('content', '', null); // content 不经过全局过滤 $this->svalidate($params); diff --git a/application/admin/lang/zh-cn/score_log.php b/application/admin/lang/zh-cn/score_log.php new file mode 100644 index 0000000..e27f395 --- /dev/null +++ b/application/admin/lang/zh-cn/score_log.php @@ -0,0 +1,26 @@ + '用户', + 'Type' => '类型', + 'Type money' => '余额', + 'Type commission' => '佣金', + 'Type score' => '积分', + 'Event' => '事件', + 'Event money_recharge' => '充值', + 'Event money_consume' => '余额消费', + 'Event commission_withdraw' => '提现', + 'Event commission_transfer' => '佣金转余额', + 'Event commission_reward' => '佣金奖励', + 'Event score_consume' => '积分消费', + 'Event score_sign' => '积分签到', + 'Event activity' => '活动赠送', + 'Amount' => '数量', + 'Before' => '变动前', + 'After' => '变动后', + 'Memo' => '备注', + 'Ext' => '扩展信息', + 'Oper_type' => '操作人类型', + 'Oper_id' => '操作人', + 'Createtime' => '创建时间' +]; diff --git a/application/admin/model/ScoreLog.php b/application/admin/model/ScoreLog.php new file mode 100644 index 0000000..244144a --- /dev/null +++ b/application/admin/model/ScoreLog.php @@ -0,0 +1,40 @@ +attrFormatComma($value, $data, 'warehouse_ids', true); + return $ids ? array_values(array_filter(array_map("intval", $ids))) : $ids; + } + public function setIsOfflineAttr($value, $data) { diff --git a/application/admin/validate/ScoreLog.php b/application/admin/validate/ScoreLog.php new file mode 100644 index 0000000..98b96ca --- /dev/null +++ b/application/admin/validate/ScoreLog.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/score_log/add.html b/application/admin/view/score_log/add.html new file mode 100644 index 0000000..dbeb9ee --- /dev/null +++ b/application/admin/view/score_log/add.html @@ -0,0 +1,69 @@ +
diff --git a/application/admin/view/score_log/edit.html b/application/admin/view/score_log/edit.html new file mode 100644 index 0000000..b455124 --- /dev/null +++ b/application/admin/view/score_log/edit.html @@ -0,0 +1,69 @@ + diff --git a/application/admin/view/score_log/index.html b/application/admin/view/score_log/index.html new file mode 100644 index 0000000..dd52780 --- /dev/null +++ b/application/admin/view/score_log/index.html @@ -0,0 +1,29 @@ +