作者 jinglong
1 个管道 的构建 通过 耗费 2 秒

修改优惠券排序

... ... @@ -72,7 +72,7 @@ class Coupon extends Backend
->select();
foreach ($list as $row) {
$row->visible(['id','c_type','is_new','gift','type','reduce','discount','coupon_number','createtime','coupon_type','end_time','coupon_name']);
$row->visible(['id','c_type','is_new','gift','type','reduce','discount','coupon_number','createtime','coupon_type','end_time','coupon_name','sort']);
}
$list = collection($list)->toArray();
... ...
... ... @@ -6,6 +6,7 @@ return [
'Bg_address' => '品牌产地',
'Is_new' => '新人专享',
'Gift' => '分享礼包',
'Sort' => '排序',
'Bg_id' => '品牌分类',
'Coupon_name' => '优惠券名称',
'C_type' => '优惠券类型',
... ...
... ... @@ -6,6 +6,7 @@ return [
'Coupon_type' => '优惠类型',
'Is_new' => '新人专享',
'Gift' => '分享礼包',
'Sort' => '排序',
'Full_reduce' => '满减金额',
'Coupon_name' => '优惠券名称',
'Reduce' => '减少金额',
... ...
... ... @@ -6,6 +6,7 @@ return [
'Bg_id' => '品牌分类',
'Is_new' => '新人专享',
'Gift' => '分享礼包',
'Sort' => '排序',
'C_type' => '优惠券类型',
'Coupon_name' => '优惠券名称',
'Coupon_type' => '优惠类型',
... ...
... ... @@ -74,6 +74,12 @@
{:build_select('row[gift]', $gift, null, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -66,6 +66,12 @@
{:build_select('row[gift]', $gift, $row.gift, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="{$row.sort|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -35,7 +35,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Brand_explain')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-brand_explain" data-rule="required" class="form-control " rows="5" name="row[brand_explain]" cols="50">{$row.brand_explain|htmlentities}</textarea>
<textarea id="c-brand_explain" data-rule="required" class="form-control editor" rows="5" name="row[brand_explain]" cols="50">{$row.brand_explain|htmlentities}</textarea>
</div>
</div>
<div class="form-group">
... ...
... ... @@ -68,6 +68,12 @@
{:build_select('row[gift]', $gift, null, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -60,6 +60,12 @@
{:build_select('row[gift]', $gift, $row.gift, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="{$row.sort|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -74,6 +74,12 @@
{:build_select('row[gift]', $gift, null, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -66,6 +66,12 @@
{:build_select('row[gift]', $gift, $row.gift, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sort" data-rule="required range(0~)" class="form-control" name="row[sort]" type="number" value="{$row.sort|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -410,7 +410,7 @@ class Cars extends Api
$where['id'] = ['in',$receive_s];
$where['end_time'] = ['>',$time];
$data = Common::selectWhereOrData('coupon',$where,$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','c_type asc,coupon_type desc');
$data = Common::selectWhereOrData('coupon',$where,$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
$res = [];
foreach($data as $key=>$value){
... ...
... ... @@ -72,7 +72,7 @@ class Coupons extends Api
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
$limit = config('verify.goods_limit');
$data = Common::selectWherePageData('coupon',$where,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number',$page,$limit,'c_type asc,coupon_type desc');
$data = Common::selectWherePageData('coupon',$where,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number',$page,$limit,'sort desc,id desc');
$res = [];
$arr = [];
foreach($data as $key=>$value){
... ... @@ -185,7 +185,7 @@ class Coupons extends Api
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
$data = Common::selectWhereData('coupon',$where,'id,c_type,coupon_type,full_reduce,reduce,discount,coupon_number','c_type asc,coupon_type desc');
$data = Common::selectWhereData('coupon',$where,'id,c_type,coupon_type,full_reduce,reduce,discount,coupon_number','sort desc,id desc');
$res = [];
foreach($data as $key=>$value){
$res[$key]['id'] = $value['id'];
... ... @@ -284,7 +284,7 @@ class Coupons extends Api
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
$data = Common::selectWhereData('coupon',$where,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number','c_type asc,coupon_type desc');
$data = Common::selectWhereData('coupon',$where,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number','sort desc,id desc');
$res = [];
foreach($data as $key=>$value){
... ...
... ... @@ -113,7 +113,7 @@ class News extends Api
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
$data = Common::selectWhereData('coupon',$where,'id,c_type,coupon_type,full_reduce,reduce,discount','c_type asc,coupon_type desc');
$data = Common::selectWhereData('coupon',$where,'id,c_type,coupon_type,full_reduce,reduce,discount','sort desc,id desc');
$res = [];
foreach($data as $key=>$value){
$res[$key]['id'] = $value['id'];
... ...
... ... @@ -395,7 +395,7 @@ class User extends Api
$receive = Common::selectWhereData('rcoupon',$where,'id,c_id');
$receive_s = array_column($receive,'c_id');
$where1['id'] = ['in',$receive_s];
$data = Common::selectWhereData('coupon',$where1,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','c_type asc,coupon_type desc');
$data = Common::selectWhereData('coupon',$where1,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
$res = [];
foreach($data as $key=>$value){
... ...
... ... @@ -75,6 +75,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'gift', title: __('Gift'),formatter: Table.api.formatter.label,searchList: {0: __('无'), 1: __('分享人'),2:__('被分享人')}},
{field: 'sort', title: __('Sort'),sortable: true},//排序
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
... ...
... ... @@ -73,6 +73,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'gift', title: __('Gift'),formatter: Table.api.formatter.label,searchList: {0: __('无'), 1: __('分享人'),2:__('被分享人')}},
{field: 'sort', title: __('Sort'),sortable: true},//排序
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
... ...
... ... @@ -74,6 +74,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'gift', title: __('Gift'),formatter: Table.api.formatter.label,searchList: {0: __('无'), 1: __('分享人'),2:__('被分享人')}},
{field: 'sort', title: __('Sort'),sortable: true},//排序
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
... ...