From 1c78652e8818e7d80b02460cf56319fee8f9879b Mon Sep 17 00:00:00 2001 From: manghe Date: Sun, 23 Mar 2025 16:14:56 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursor/rules/mhbase.mdc | 16 ++++++++++++++++ app/admin/controller/GoodsType.php | 20 ++++++++++++++++++++ app/admin/view/Goods/type_add.html | 17 +++++++++++++++++ app/admin/view/Goods/type_edit.html | 17 +++++++++++++++++ app/admin/view/Goods/type_index.html | 16 ++++++++++++++++ app/api/controller/Goods.php | 9 +++++---- 6 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 .cursor/rules/mhbase.mdc diff --git a/.cursor/rules/mhbase.mdc b/.cursor/rules/mhbase.mdc new file mode 100644 index 0000000..8097a0c --- /dev/null +++ b/.cursor/rules/mhbase.mdc @@ -0,0 +1,16 @@ +--- +description: +globs: +alwaysApply: true +--- +项目配置文件:.env +本项目使用:php 7.4,ThinkPHPV6.0 框架 +后台管理: + 项目文件夹:app/admin + 路由文件:app/admin/route/app.php + 控制器文件夹:app/admin/controller + 视图文件夹:app/admin/view +api项目文件夹:app/api + 项目文件夹:app/api/controller + 路由文件:app/api/route/app.php +实体类文件夹:app/common/model diff --git a/app/admin/controller/GoodsType.php b/app/admin/controller/GoodsType.php index 82b14be..1328e6c 100644 --- a/app/admin/controller/GoodsType.php +++ b/app/admin/controller/GoodsType.php @@ -54,6 +54,16 @@ class GoodsType extends Base $data['is_fenlei'] = isset($data['is_fenlei']) ? 1 : 0; $data['sort_order'] = intval($data['sort_order']); + // 处理支付方式复选框 + $data['pay_wechat'] = isset($data['pay_wechat']) ? 1 : 0; + $data['pay_balance'] = isset($data['pay_balance']) ? 1 : 0; + $data['pay_currency'] = isset($data['pay_currency']) ? 1 : 0; + $data['pay_currency2'] = isset($data['pay_currency2']) ? 1 : 0; + $data['pay_coupon'] = isset($data['pay_coupon']) ? 1 : 0; + + // 处理支付类型 + $data['is_deduction'] = isset($data['is_deduction']) ? 1 : 0; + // 保存数据 $result = GoodsTypeModel::add($data); if ($result) { @@ -105,6 +115,16 @@ class GoodsType extends Base $data['is_fenlei'] = isset($data['is_fenlei']) ? 1 : 0; $data['sort_order'] = intval($data['sort_order']); + // 处理支付方式复选框 + $data['pay_wechat'] = isset($data['pay_wechat']) ? 1 : 0; + $data['pay_balance'] = isset($data['pay_balance']) ? 1 : 0; + $data['pay_currency'] = isset($data['pay_currency']) ? 1 : 0; + $data['pay_currency2'] = isset($data['pay_currency2']) ? 1 : 0; + $data['pay_coupon'] = isset($data['pay_coupon']) ? 1 : 0; + + // 处理支付类型 + $data['is_deduction'] = isset($data['is_deduction']) ? 1 : 0; + // 更新数据 $result = GoodsTypeModel::edit($id, $data); if ($result) { diff --git a/app/admin/view/Goods/type_add.html b/app/admin/view/Goods/type_add.html index 8b026ef..a746aa4 100644 --- a/app/admin/view/Goods/type_add.html +++ b/app/admin/view/Goods/type_add.html @@ -44,6 +44,23 @@
如果分类显示为"是",则必须填写分类名称
+
+ +
+ + + + + +
+
+
+ +
+ +
抵扣:使用的是优惠,支付:使用的是实际支付
+
+
diff --git a/app/admin/view/Goods/type_edit.html b/app/admin/view/Goods/type_edit.html index b8bcb26..312a421 100644 --- a/app/admin/view/Goods/type_edit.html +++ b/app/admin/view/Goods/type_edit.html @@ -45,6 +45,23 @@
如果分类显示为"是",则必须填写分类名称
+
+ +
+ + + + + +
+
+
+ +
+ +
抵扣:使用的是优惠,支付:使用的是实际支付
+
+
diff --git a/app/admin/view/Goods/type_index.html b/app/admin/view/Goods/type_index.html index e356e0e..f0819f3 100644 --- a/app/admin/view/Goods/type_index.html +++ b/app/admin/view/Goods/type_index.html @@ -58,6 +58,22 @@ {field: 'is_show', title: '首页显示', width: 120, templet: '#isShowTpl'}, {field: 'is_fenlei', title: '分类显示', width: 120, templet: '#isFenleiTpl'}, {field: 'fl_name', title: '分类名称', width: 150}, + {title: '支付方式', minWidth: 200, templet: function(d){ + var html = ''; + if(d.pay_wechat == 1) html += '微信 '; + if(d.pay_balance == 1) html += '余额 '; + if(d.pay_currency == 1) html += '货币 '; + if(d.pay_currency2 == 1) html += '货币2 '; + if(d.pay_coupon == 1) html += '优惠券 '; + return html; + }}, + {title: '支付类型', width: 100, templet: function(d){ + if(d.is_deduction == 1) { + return '抵扣'; + } else { + return '支付'; + } + }}, {field: 'remark', title: '备注', width: 200}, {fixed: 'right', title: '操作', toolbar: '#operationTpl', width: 150} ]], diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index dddaa6d..4853169 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -691,8 +691,9 @@ class Goods extends Base $prize_num = request()->param('prize_num/d', 0); #抽几发 $goods_id = request()->param('goods_id/d', 0); #盒子ID $num = request()->param('goods_num/d', 0); #第几箱 - $use_money_is = request()->param('use_money_is/d', 0); #0不抵扣 1抵扣 - $use_integral_is = request()->param('use_integral_is/d', 0); #0不抵扣 1抵扣 + $use_money_is = request()->param('use_money_is/d', 0); #0不抵扣 1抵扣 余额抵扣 + $use_integral_is = request()->param('use_integral_is/d', 0); #0不抵扣 1抵扣 货币1抵扣 + $use_money2_is = request()->param('use_integral_is/d', 0); #0不抵扣 1抵扣 货币2抵扣 $coupon_id = request()->param('coupon_id/d', 0); //优惠券 #盒子信息 @@ -823,7 +824,7 @@ class Goods extends Base $zhe_bl = bcdiv("$zhe", "10", 2); $order_zhe_total = $price = bcmul("$price", "$zhe_bl", 2); } - #吧唧币抵扣 + #货币1抵扣 $use_integral = 0; if ($use_integral_is == 1 && $goods['type'] != 10) { $price = $price * 100; @@ -859,7 +860,7 @@ class Goods extends Base $zhe = 0; #微信支付 $price = 0; - #吧唧币抵扣 + #货币1币抵扣 $use_integral = 0; #余额抵扣 $use_money = 0;