setter
parent
2b48bfc79b
commit
307b511ea1
|
@ -384,6 +384,7 @@ class Business extends Base
|
|||
$data["lat"] = $couponMain->lat;
|
||||
$data["lng"] = $couponMain->lng;
|
||||
$data["money"] = $couponMain->money;
|
||||
$data["is_distribution"] = $couponMain->is_distribution;
|
||||
$data["usingRule"] = DictionaryRepository::getInstance()->getUsingRuleByCouponMainId($couponMain->id);
|
||||
$data["punishRule"] = '';//处罚规则 已取消
|
||||
|
||||
|
|
|
@ -287,9 +287,10 @@ class Coupon extends Base
|
|||
* */
|
||||
public function receiveCoupon()
|
||||
{
|
||||
$accountId = $this->request->user['user_id'] ?? 0;
|
||||
$lat = input("lat/f",0);
|
||||
$lng = input("lng/f",0);
|
||||
$accountId = $this->request->user['user_id'] ?? 0;
|
||||
$lat = input("lat/f",0);
|
||||
$lng = input("lng/f",0);
|
||||
$distributionUserCode = input("distribution_user_code/s",'');
|
||||
$account = AccountRepository::getInstance()->findById($accountId, [], function ($q) {
|
||||
return $q->with(['business', 'parent']);
|
||||
});
|
||||
|
@ -336,22 +337,23 @@ class Coupon extends Base
|
|||
try {
|
||||
//写入领取记录
|
||||
$data = [
|
||||
"coupon_id" =>$couponMain->id,
|
||||
"name" =>$couponMain->name,
|
||||
"type_id" =>$couponMain->type,
|
||||
"type_name" =>$couponMain->type_name,
|
||||
"business_code" =>$couponMain->business_code,
|
||||
"business_name" =>$couponMain->business?$couponMain->business->business_name:'',
|
||||
"consumer_code" =>$account->user_code,
|
||||
"consumer_name" =>$account->nick_name,
|
||||
"money" => $couponMain->money,
|
||||
"content" => createUuid(),//未知作用
|
||||
"received_time" => date("Y-m-d H:i:s",$time),
|
||||
"lat" => $lat,
|
||||
"lng" => $lng,
|
||||
"end_time" => date($couponMain->end_time . " 00:00:00"),
|
||||
"edition" => couponMain::COMMON_ON,//版本 未知作用
|
||||
"is_verificated" => couponMain::COMMON_OFF,//版本 未知作用
|
||||
"coupon_id" =>$couponMain->id,
|
||||
"name" =>$couponMain->name,
|
||||
"type_id" =>$couponMain->type,
|
||||
"type_name" =>$couponMain->type_name,
|
||||
"business_code" =>$couponMain->business_code,
|
||||
"business_name" =>$couponMain->business?$couponMain->business->business_name:'',
|
||||
"consumer_code" =>$account->user_code,
|
||||
"consumer_name" =>$account->nick_name,
|
||||
"money" => $couponMain->money,
|
||||
"content" => createUuid(),//未知作用
|
||||
"received_time" => date("Y-m-d H:i:s",$time),
|
||||
"lat" => $lat,
|
||||
"lng" => $lng,
|
||||
"end_time" => date($couponMain->end_time . " 00:00:00"),
|
||||
"edition" => couponMain::COMMON_ON,//版本 未知作用
|
||||
"is_verificated" => couponMain::COMMON_OFF,//版本 未知作用
|
||||
"distribution_user_code" => $distributionUserCode,//分销人user_code
|
||||
];
|
||||
CouponRepository::getInstance()->receiveCoupon($data);
|
||||
$couponMain->save(["received_count"=>Db::raw("received_count + 1")]);
|
||||
|
@ -666,7 +668,9 @@ class Coupon extends Base
|
|||
$data = input();
|
||||
|
||||
Config::load("extra/distribution_proportion","distribution_proportion");
|
||||
$distributionProportion = config("distribution_proportion");
|
||||
Config::load("extra/distribution_proportion_user","distribution_proportion_user");
|
||||
$distributionProportion = config("distribution_proportion");
|
||||
$distributionProportionUser = config("distribution_proportion_user");
|
||||
|
||||
$totalC = $distributionProportion['agency'] + $distributionProportion['admin'] + $distributionProportion['consumer'];
|
||||
if ($totalC != 100) {
|
||||
|
@ -687,25 +691,31 @@ class Coupon extends Base
|
|||
|
||||
//验证通过 不管是商家还是工作人员 都可以发布优惠券
|
||||
$couponMain = [
|
||||
"name" => $data['name'] ?? '',
|
||||
"business_code" => $account->business->code,
|
||||
"name" => $data['name'] ?? '',
|
||||
"business_code" => $account->business->code,
|
||||
//"money" => $data['money'] ?? 0,
|
||||
"type" => $data['type'] ?? 0,
|
||||
"count" => $data['count'] ?? 0,
|
||||
"type_name" => $data['type_name'] ?? '',
|
||||
"start_time" => $data['start_time'] ?? '',
|
||||
"end_time" => $data['end_time'] ?? '',
|
||||
"deduction_money" => $data['deduction_money'] ?? '',
|
||||
"image_url" => $data['image_url'] ?? '',
|
||||
"intro" => $data['intro'] ?? '',
|
||||
"content" => $data['content'] ?? '',
|
||||
"white_list" => $data['white_list'] ?? '',
|
||||
"status" => CouponMain::status_on,
|
||||
"on_shelf" => CouponMain::on_shelf_off,//默认下架 后台审核上架
|
||||
"on_screen" => CouponMain::on_screen_yes,
|
||||
"commission_agency" => $distributionProportion['agency'],
|
||||
"commission_admin" => $distributionProportion['admin'],
|
||||
"commission_consumer" => $distributionProportion['consumer'],
|
||||
"type" => $data['type'] ?? 0,
|
||||
"count" => $data['count'] ?? 0,
|
||||
"type_name" => $data['type_name'] ?? '',
|
||||
"start_time" => $data['start_time'] ?? '',
|
||||
"end_time" => $data['end_time'] ?? '',
|
||||
"deduction_money" => $data['deduction_money'] ?? '',
|
||||
"image_url" => $data['image_url'] ?? '',
|
||||
"intro" => $data['intro'] ?? '',
|
||||
"content" => $data['content'] ?? '',
|
||||
"white_list" => $data['white_list'] ?? '',
|
||||
"status" => CouponMain::status_on,
|
||||
"on_shelf" => CouponMain::on_shelf_off,//默认下架 后台审核上架
|
||||
"on_screen" => CouponMain::on_screen_yes,
|
||||
"is_distribution" => CouponMain::COMMON_OFF,//默认关闭分销
|
||||
|
||||
//下面是分配比例
|
||||
"commission_agency" => $distributionProportion['agency'],
|
||||
"commission_admin" => $distributionProportion['admin'],
|
||||
"commission_consumer" => $distributionProportion['consumer'],
|
||||
"commission_dis_admin" => $distributionProportionUser['admin'],
|
||||
"commission_dis_distribution" => $distributionProportionUser['distribution'],
|
||||
"commission_dis_distributed" => $distributionProportionUser['distributed'],
|
||||
];
|
||||
|
||||
//$usingRule = input("using_rule/a");
|
||||
|
@ -743,10 +753,10 @@ class Coupon extends Base
|
|||
$couponMain['deduction_money'] = floor($couponMain['deduction_money'] * 100) / 100;
|
||||
$totalMoney = $couponMain['deduction_money'] * $couponMain['count'];
|
||||
|
||||
//检测消费者部分是否最少1元
|
||||
//检测消费者部分是否最少0.3元
|
||||
$consumerMoney = ($couponMain['commission_consumer']/100) * $couponMain['deduction_money'];
|
||||
if ($consumerMoney != 0 && $consumerMoney < CouponMain::min_consumer_money) {
|
||||
return $this->json(4002, "消费者红包最低" . CouponMain::min_consumer_money . "元");
|
||||
if ($consumerMoney != 0 && $consumerMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002, "扣除金额最低" . (CouponMain::min_redpack_money * (100 / ($data['commission_consumer']))) . "元");
|
||||
}
|
||||
|
||||
//未领取的优惠券
|
||||
|
|
|
@ -189,9 +189,9 @@ class Config extends Base
|
|||
$data = input("post.");
|
||||
unset($data['_token']);
|
||||
$validate = $this->validateByApi($data, [
|
||||
'agency' => 'require|number',
|
||||
'admin' => 'require|number',
|
||||
'consumer' => 'require|number',
|
||||
'agency|渠道商占比' => 'require|number',
|
||||
'admin|平台占比' => 'require|number',
|
||||
'consumer|消费者占比' => 'require|number',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
|
@ -210,4 +210,31 @@ class Config extends Base
|
|||
return $this->view();
|
||||
}
|
||||
}
|
||||
/* 分配比例-分销*/
|
||||
public function distributionProportionUser(){
|
||||
if ($this->request->isPost()) {
|
||||
$data = input("post.");
|
||||
unset($data['_token']);
|
||||
$validate = $this->validateByApi($data, [
|
||||
'admin|平台占比' => 'require|number',
|
||||
'distribution|(领券)分销者占比' => 'require|number',
|
||||
'distributed|(核销)被分销者占比' => 'require|number',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
return $validate;
|
||||
}
|
||||
$total = $data['admin'] + $data['distribution'] + $data['distributed'];
|
||||
if ($total != 100) {
|
||||
return $this->json(5002,"分配比例总和不等于100");
|
||||
}
|
||||
$php = var_export($data, true);
|
||||
file_put_contents($this->extraPath . 'distribution_proportion_user.php', '<?php' . PHP_EOL . 'return ' . $php . ';');
|
||||
return $this->json();
|
||||
} else {
|
||||
CConfig::load('extra/distribution_proportion_user', 'distributionProportionUser');
|
||||
$this->data['item'] = config('distributionProportionUser');
|
||||
return $this->view();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,7 +35,9 @@ class Coupon extends Base
|
|||
{
|
||||
parent::initialize(); // TODO: Change the autogenerated stub
|
||||
CConfig::load('extra/distribution_proportion', 'distributionProportion');
|
||||
CConfig::load('extra/distribution_proportion_user', 'distributionProportionUser');
|
||||
$this->data['distributionProportion'] = config('distributionProportion');
|
||||
$this->data['distributionProportionUser'] = config('distributionProportionUser');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -222,22 +224,61 @@ class Coupon extends Base
|
|||
|
||||
|
||||
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0,"abs");
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0,"abs");
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0,"abs");
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0,"abs");
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0,"abs");
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0,"abs");
|
||||
$data['commission_dis_admin'] = input("item.commission_dis_admin/d", 0,"abs");
|
||||
$data['commission_dis_distribution'] = input("item.commission_dis_distribution/d", 0,"abs");
|
||||
$data['commission_dis_distributed'] = input("item.commission_dis_distributed/d", 0,"abs");
|
||||
|
||||
$totalC = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalC != 100) {
|
||||
$totalCommission = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalCommission != 100) {
|
||||
return $this->json(5002, "分配比例总和不等于100");
|
||||
}
|
||||
$totalCommissionDis = $data['commission_dis_admin'] + $data['commission_dis_distribution'] + $data['commission_dis_distributed'];
|
||||
if ($totalCommissionDis != 100) {
|
||||
return $this->json(5002, "(开启分销)分配比例总和不等于100");
|
||||
}
|
||||
|
||||
//保留两位小数
|
||||
$data['deduction_money'] = floor($data['deduction_money'] * 100) / 100;
|
||||
|
||||
//检测消费者部分是否最少1元
|
||||
//检测消费者部分是否最少0.3元
|
||||
$consumerMoney = ($data['commission_consumer']/100) * $data['deduction_money'];
|
||||
if ($consumerMoney != 0 && $consumerMoney < CouponMain::min_consumer_money) {
|
||||
return $this->json(4002, "消费者红包最低" . CouponMain::min_consumer_money . "元");
|
||||
if ($consumerMoney != 0 && $consumerMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
"【分销者】红包不足"
|
||||
.CouponMain::min_redpack_money
|
||||
.";当前比例扣除金额最低"
|
||||
. (CouponMain::min_redpack_money * (100 / ($data['commission_consumer'])))
|
||||
. "元");
|
||||
}
|
||||
|
||||
//如果开启分销 添加操作 处理扣除金额
|
||||
if($data["is_distribution"] == CouponMain::COMMON_ON ){
|
||||
if($data['commission_dis_distribution']>$data['commission_dis_distributed']){
|
||||
//检测【分销者】部分是否最少0.3元
|
||||
$distributionMoney = ($data['commission_dis_distribution']/100) * $data['deduction_money'];
|
||||
if ($distributionMoney != 0 && $distributionMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
"开启分销后:【分销者】红包不足"
|
||||
.CouponMain::min_redpack_money
|
||||
.",扣除金额最低" .
|
||||
(CouponMain::min_redpack_money * (100 / ($data['commission_dis_distribution'])))
|
||||
. "元");
|
||||
}
|
||||
}else{
|
||||
//检测【被分销者】部分是否最少0.3元
|
||||
$distributedMoney = ($data['commission_dis_distributed']/100) * $data['deduction_money'];
|
||||
if ($distributedMoney != 0 && $distributedMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
"开启分销后:【被分销者】红包不足"
|
||||
.CouponMain::min_redpack_money
|
||||
.",扣除金额最低" .
|
||||
(CouponMain::min_redpack_money * (100 / ($data['commission_dis_distribution'])))
|
||||
. "元");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,13 +371,50 @@ class Coupon extends Base
|
|||
$data['lat'] = $business['lat'];
|
||||
|
||||
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0);
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0);
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0);
|
||||
$totalC = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalC != 100) {
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0,"abs");
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0,"abs");
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0,"abs");
|
||||
$data['commission_dis_admin'] = input("item.commission_dis_admin/d", 0,"abs");
|
||||
$data['commission_dis_distribution'] = input("item.commission_dis_distribution/d", 0,"abs");
|
||||
$data['commission_dis_distributed'] = input("item.commission_dis_distributed/d", 0,"abs");
|
||||
|
||||
$totalCommission = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalCommission != 100) {
|
||||
return $this->json(5002, "分配比例总和不等于100");
|
||||
}
|
||||
$totalCommissionDis = $data['commission_dis_admin'] + $data['commission_dis_distribution'] + $data['commission_dis_distributed'];
|
||||
if ($totalCommissionDis != 100) {
|
||||
return $this->json(5002, "(开启分销)分配比例总和不等于100");
|
||||
}
|
||||
|
||||
//如果开启分销 添加操作 处理扣除金额
|
||||
if($data["is_distribution"] == CouponMain::COMMON_ON ){
|
||||
|
||||
//检测【分销者】部分是否最少0.3元
|
||||
$distributionMoney = ($data['commission_dis_distribution']/100) * $data['deduction_money'];
|
||||
if ($distributionMoney != 0 && $distributionMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
"开启分销后:【分销者】红包不足"
|
||||
.CouponMain::min_redpack_money
|
||||
.",(领券)分销者占比最低" .
|
||||
( round((CouponMain::min_redpack_money / ($data['deduction_money']) )*100,2))
|
||||
. "%"
|
||||
);
|
||||
}
|
||||
|
||||
//检测【被分销者】部分是否最少0.3元
|
||||
$distributedMoney = ($data['commission_dis_distributed']/100) * $data['deduction_money'];
|
||||
if ($distributedMoney != 0 && $distributedMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
"开启分销后:【被分销者】红包不足"
|
||||
.CouponMain::min_redpack_money
|
||||
.",(核销)被分销者占比最低" .
|
||||
( round((CouponMain::min_redpack_money / ($data['deduction_money']) )*100,2))
|
||||
. "%");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data['update_time'] = date("Y-m-d H:i:s");
|
||||
|
||||
|
@ -408,5 +486,58 @@ class Coupon extends Base
|
|||
return download(public_path() . $path,$couponMain['name']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置分销开关
|
||||
*
|
||||
* */
|
||||
public function setDistribution()
|
||||
{
|
||||
$ids = input("ids/a", []);
|
||||
$isDistribution = input("is_distribution/d");
|
||||
//如果是开启分销操作
|
||||
if ($isDistribution == CouponMain::COMMON_ON) {
|
||||
$couponMains = CouponMain::findList([["id", "in", $ids]], [],1,0);
|
||||
foreach ($couponMains["list"] as $key=> $item) {
|
||||
//如果开启分销 添加操作 处理扣除金额
|
||||
if ($item["is_distribution"] == CouponMain::COMMON_OFF) {
|
||||
|
||||
//检测【分销者】部分是否最少0.3元
|
||||
$distributionMoney = ($item['commission_dis_distribution'] / 100) * $item['deduction_money'];
|
||||
if ($distributionMoney != 0 && $distributionMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
$item['name']
|
||||
."开启分销后:【分销者】红包不足"
|
||||
. CouponMain::min_redpack_money
|
||||
. ",(领券)分销者占比最低" .
|
||||
(round((CouponMain::min_redpack_money / ($item['deduction_money'])) * 100, 2))
|
||||
. "%"
|
||||
);
|
||||
}
|
||||
|
||||
//检测【被分销者】部分是否最少0.3元
|
||||
$distributedMoney = ($item['commission_dis_distributed'] / 100) * $item['deduction_money'];
|
||||
if ($distributedMoney != 0 && $distributedMoney < CouponMain::min_redpack_money) {
|
||||
return $this->json(4002,
|
||||
$item['name']
|
||||
. "开启分销后:【被分销者】红包不足"
|
||||
. CouponMain::min_redpack_money
|
||||
. ",(核销)被分销者占比最低" .
|
||||
(round((CouponMain::min_redpack_money / ($item['deduction_money'])) * 100, 2))
|
||||
. "%");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
CouponMain::whereIn("id",$ids)->update(["is_distribution"=>$isDistribution]);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json(5001, "设置失败".$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ class CouponMain extends Base
|
|||
const on_screen_yes = 1;//展示到商圈大屏
|
||||
const on_screen_no = 0;//不展示到商圈大屏
|
||||
|
||||
const min_consumer_money = 0.3;//
|
||||
const min_redpack_money = 0.3;//
|
||||
|
||||
const receive_status_over = 2;//领取状态 已领完
|
||||
const receive_status_received = 1;//领取状态 已领完
|
||||
|
|
|
@ -42,7 +42,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate']
|
|||
},
|
||||
page: true,
|
||||
cols: [[
|
||||
// {type: 'checkbox'},
|
||||
{type: 'checkbox'},
|
||||
{field: 'id' , width: 80, title: 'ID'},
|
||||
|
||||
{field: 'name', title: '名称'},
|
||||
|
@ -109,9 +109,75 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate']
|
|||
openLayer(url, title, width, height);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (layEvent === 'distribution') {
|
||||
|
||||
let ids = [$(this).data('value')];
|
||||
setDistribution(url, ids);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//监听工具条 注意区别toolbar和tool toolbar是表头上的工具条 tool是行中的工具条
|
||||
table.on('toolbar(table-container)', function (obj) {
|
||||
let layEvent = obj.event;
|
||||
let insTb = Tools.getInsTb();
|
||||
let url = $($(this).context).data('href')
|
||||
let title = $($(this).context).data('title')
|
||||
let width = $($(this).context).data('width') ? $($(this).context).data('width') : '100%';
|
||||
let height = $($(this).context).data('height') ? $($(this).context).data('height') : '100%';
|
||||
|
||||
// debugger;
|
||||
switch (layEvent) {
|
||||
|
||||
// toolbar 刷新
|
||||
case 'refresh':
|
||||
refreshTab(insTb);
|
||||
return false;
|
||||
|
||||
case 'distribution':
|
||||
let checkStatus = table.checkStatus('table-container');
|
||||
if (checkStatus.data.length <= 0) {
|
||||
layer.msg('请先选择数据');
|
||||
return false;
|
||||
}
|
||||
let selected = checkStatus.data;
|
||||
let ids = [];
|
||||
|
||||
$.each(selected, function (index, val) {
|
||||
ids.push(val.id);
|
||||
});
|
||||
setDistribution(url, ids);
|
||||
return false;
|
||||
|
||||
// 其他 默认为打开弹出层
|
||||
default:
|
||||
if (layEvent !== 'LAYTABLE_COLS' && layEvent !== 'LAYTABLE_EXPORT') {
|
||||
openLayer(url, title, width, height);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//删除
|
||||
function setDistribution(url, ids) {
|
||||
let index = layer.confirm('确认操作吗?', {
|
||||
btn: ['确认','取消'], //按钮
|
||||
title: '操作提示',
|
||||
}, function() {
|
||||
$.post(url, {
|
||||
ids: ids,
|
||||
}, function (res) {
|
||||
layer.msg(res.msg)
|
||||
if (res.code === 0) {
|
||||
insTb.reload();
|
||||
}
|
||||
})
|
||||
}, function(){
|
||||
layer.close(index)
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
/*** index end ***/
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="admin" value="{$item.admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(领券)分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="distribution" value="{$item.distribution ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(核销)被分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="distributed" value="{$item.distributed ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/config/distribution-proportion-user" lay-submit lay-filter="saveConfig">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -183,6 +183,14 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开启分销</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="item[is_distribution]" value="1" title="开启" />
|
||||
<input type="radio" checked="checked" name="item[is_distribution]" value="0" title="关闭" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">展示到商圈大屏</label>
|
||||
<div class="layui-input-block">
|
||||
|
@ -243,6 +251,40 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">(开启分销状态)请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_admin]" lay-verify="required|number" value="{$distributionProportionUser.admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(领券)分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_distribution]" lay-verify="required|number" value="{$distributionProportionUser.distribution ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(核销)被分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_distributed]" lay-verify="required|number" value="{$distributionProportionUser.distributed ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/coupon/release" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
|
|
|
@ -182,6 +182,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开启分销</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" {if $item['is_distribution']==1 } checked="checked" {/if} name="item[is_distribution]" value="1" title="开启" />
|
||||
<input type="radio" {if $item['is_distribution']==0 } checked="checked" {/if} name="item[is_distribution]" value="0" title="关闭" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">展示到商圈大屏</label>
|
||||
|
@ -251,6 +260,41 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">(开启分销状态)请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_admin]" lay-verify="required|number" value="{$item.commission_dis_admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(领券)分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_distribution]" lay-verify="required|number" value="{$item.commission_dis_distribution ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">(核销)被分销者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_dis_distributed]" lay-verify="required|number" value="{$item.commission_dis_distributed ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="id" value="{$item['id']}">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
|
|
|
@ -93,6 +93,18 @@
|
|||
{{# }else{ }}
|
||||
<a class="layui-btn layui-btn-xs" data-href="/manager/coupon/shelf.html?id={{d.id}}&&on_shelf=1" lay-event="shelf">下架</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.is_distribution == 1){ }}
|
||||
<a class="layui-btn layui-btn-xs"
|
||||
data-href="/manager/coupon/set-distribution.html?is_distribution=0"
|
||||
data-value="{{d.id}}"
|
||||
lay-event="distribution">关闭分销</a>
|
||||
{{# }else{ }}
|
||||
<a class="layui-btn layui-btn-xs"
|
||||
data-href="/manager/coupon/set-distribution.html?is_distribution=1"
|
||||
data-value="{{d.id}}"
|
||||
lay-event="distribution">开启分销</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" target="_blank" href="/manager/coupon/downloadQrCode.html?id={{d.id}}">下载二维码</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/edit.html?id={{d.id}}" data-title="【{{ d.name }}】编辑" lay-event="info">编辑</a>
|
||||
</script>
|
||||
|
@ -101,6 +113,12 @@
|
|||
<script type="text/html" id="toolbar-tpl">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-href="/manager/coupon/release" lay-event="release" date-title="发布优惠券">发布优惠券</a>
|
||||
<a class="layui-btn layui-btn-sm"
|
||||
data-href="/manager/coupon/set-distribution?is_distribution=1"
|
||||
lay-event="distribution" date-title="开启分销">开启分销</a>
|
||||
<a class="layui-btn layui-btn-sm"
|
||||
data-href="/manager/coupon/set-distribution?is_distribution=1"
|
||||
lay-event="distribution" date-title="开启分销">关闭分销</a>
|
||||
</script>
|
||||
<!-- 列 性别 -->
|
||||
<script type="text/html" id="row-on_shelf">
|
||||
|
|
Loading…
Reference in New Issue