master
wangxinglong 2022-03-24 10:59:46 +08:00
parent a84fee55e9
commit 0b42134723
3 changed files with 9 additions and 4 deletions

View File

@ -31,6 +31,7 @@ class Coupon extends Base
{ {
protected $noNeedLogin = ["downloadQrCode"]; protected $noNeedLogin = ["downloadQrCode"];
protected function initialize() protected function initialize()
{ {
parent::initialize(); // TODO: Change the autogenerated stub parent::initialize(); // TODO: Change the autogenerated stub
@ -191,6 +192,7 @@ class Coupon extends Base
return $this->json(4001, $validate->getError()); return $this->json(4001, $validate->getError());
} }
//$usingRuleValidate = new CouponUsingRule(); //$usingRuleValidate = new CouponUsingRule();
//if (!$usingRuleValidate->check($usingRule)) { //if (!$usingRuleValidate->check($usingRule)) {
// return $this->json(4001, $usingRuleValidate->getError()); // return $this->json(4001, $usingRuleValidate->getError());

View File

@ -48,7 +48,7 @@ class CouponRelease extends Validate
// edit 验证场景定义 // edit 验证场景定义
public function sceneOrdinary() public function sceneOrdinary()
{ {
return $this->append('deduction_money', 'checkDeductionMoney'); return $this->append('checkDeductionMoney');
} }
protected function checkEndTime($value, $rule, $data = []) protected function checkEndTime($value, $rule, $data = [])
@ -63,10 +63,13 @@ class CouponRelease extends Validate
protected function checkDeductionMoney($value, $rule, $data = []) protected function checkDeductionMoney($value, $rule, $data = [])
{ {
if ($value <= 0) {
return "最小扣除佣金不能为0";
}
//最小充值 //最小充值
Config::load('extra/wechat', 'wechat'); Config::load('extra/wechat', 'wechat');
$minCouponDeductionMoney = config('wechat.minCouponDeductionMoney') ?? 0; $minCouponDeductionMoney = config('wechat.minCouponDeductionMoney') ?? 0;
if($minCouponDeductionMoney > 0 &&$minCouponDeductionMoney>$value){ if ($minCouponDeductionMoney > $value) {
return "最小扣除佣金{$minCouponDeductionMoney}"; return "最小扣除佣金{$minCouponDeductionMoney}";
} }
return true; return true;

View File

@ -50,8 +50,8 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate']
{field: 'business_name', title: '所属商家'}, {field: 'business_name', title: '所属商家'},
{field: 'business_subtitle', title: '商家简称'}, {field: 'business_subtitle', title: '商家简称'},
{field: 'agency_text', title: '渠道商名称'}, {field: 'agency_text', title: '渠道商名称'},
{field: 'money', title: '金额'}, // {field: 'money', title: '金额'},
{field: 'deduction_money', title: '扣'}, {field: 'deduction_money', title: '扣除金额'},
{field: 'start_time', title: '开始时间'}, {field: 'start_time', title: '开始时间'},
{field: 'end_time', title: '结束时间'}, {field: 'end_time', title: '结束时间'},
{templet: '#row-on_shelf', title: '上下架'}, {templet: '#row-on_shelf', title: '上下架'},