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

修改优惠券的有效开始日期

... ... @@ -229,6 +229,7 @@ class Bcoupon extends Backend
}
$this->error(__('Parameter %s can not be empty', ''));
}
$row->start_time = date('Y-m-d H:i:s',$row->start_time);
$row->end_time = date('Y-m-d H:i:s',$row->end_time);
$this->view->assign("row", $row);
return $this->view->fetch();
... ...
... ... @@ -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','sort']);
$row->visible(['id','c_type','is_new','gift','type','reduce','discount','coupon_number','createtime','coupon_type','end_time','coupon_name','sort','start_time']);
}
$list = collection($list)->toArray();
... ... @@ -222,6 +222,7 @@ class Coupon extends Backend
}
$this->error(__('Parameter %s can not be empty', ''));
}
$row->start_time = date('Y-m-d H:i:s',$row->start_time);
$row->end_time = date('Y-m-d H:i:s',$row->end_time);
$this->view->assign("row", $row);
return $this->view->fetch();
... ...
... ... @@ -229,6 +229,7 @@ class Gcoupon extends Backend
}
$this->error(__('Parameter %s can not be empty', ''));
}
$row->start_time = date('Y-m-d H:i:s',$row->start_time);
$row->end_time = date('Y-m-d H:i:s',$row->end_time);
$this->view->assign("row", $row);
return $this->view->fetch();
... ...
... ... @@ -15,6 +15,7 @@ return [
'Reduce' => '减少金额',
'Discount' => '折扣(折)',
'Coupon_number' => '优惠券数量',
'Start_time' => '有效开始日期',
'End_time' => '有效截止日期',
'Createtime' => '创建时间',
'Updatetime' => '更新时间'
... ...
... ... @@ -12,6 +12,7 @@ return [
'Reduce' => '减少金额',
'Discount' => '折扣(折)',
'Coupon_number' => '优惠券数量',
'Start_time' => '有效开始日期',
'End_time' => '有效截止日期',
'Createtime' => '创建时间',
'Updatetime' => '更新时间'
... ...
... ... @@ -14,6 +14,7 @@ return [
'Reduce' => '减少金额',
'Discount' => '折扣(折)',
'Coupon_number' => '优惠券数量',
'Start_time' => '有效开始日期',
'End_time' => '有效截止日期',
'Createtime' => '创建时间',
'Updatetime' => '更新时间'
... ...
... ... @@ -63,6 +63,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="">
... ...
... ... @@ -55,6 +55,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{$row.end_time|htmlentities}">
... ...
... ... @@ -57,6 +57,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="">
... ...
... ... @@ -49,6 +49,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{$row.end_time|htmlentities}">
... ...
... ... @@ -63,6 +63,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="">
... ...
... ... @@ -55,6 +55,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{$row.end_time|htmlentities}">
... ...
... ... @@ -422,6 +422,7 @@ class Cars extends Api
$time = time();
$where['id'] = ['in',$receive_s];
$where['start_time'] = ['<',$time];
$where['end_time'] = ['>',$time];
$data = Common::selectWhereData('coupon',$where,'id,type,coupon_name,c_type,bg_id,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
... ...
... ... @@ -67,7 +67,8 @@ class Coupons extends Api
}
$flag = config('verify.flag');
$where = ['is_new'=>$flag[0],'end_time'=>['>',time()]];
$current_time = time();
$where = ['is_new'=>$flag[0],'start_time'=>['<',$current_time],'end_time'=>['>',$current_time]];
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
... ... @@ -181,7 +182,8 @@ class Coupons extends Api
}
$flag = config('verify.flag');
$where = ['is_new'=>$flag[0],'type'=>$flag[1],'bg_id'=>$b_id,'end_time'=>['>',time()]];
$current_time = time();
$where = ['is_new'=>$flag[0],'type'=>$flag[1],'bg_id'=>$b_id,'start_time'=>['<',$current_time],'end_time'=>['>',$current_time]];
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
... ... @@ -279,7 +281,8 @@ class Coupons extends Api
}
$type = config('verify.type');
$where = ['type'=>$type[2],'bg_id'=>$goods_id,'end_time'=>['>',time()]];
$current_time = time();
$where = ['type'=>$type[2],'bg_id'=>$goods_id,'start_time'=>['<',$current_time],'end_time'=>['>',$current_time]];
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
... ...
... ... @@ -149,7 +149,8 @@ class News extends Api
public function newsCouponList(){
if($this->request->isGet()){
$flag = config('verify.flag');
$where = ['is_new'=>$flag[1],'coupon_number'=>['<>',0],'end_time'=>['>',time()]];
$current_time = time();
$where = ['is_new'=>$flag[1],'coupon_number'=>['<>',0],'start_time'=>['<',$current_time],'end_time'=>['>',$current_time]];
//查询已经领取过
$receive = Common::selectWhereData('rcoupon',['uid'=>$this->uid],'id,c_id');
$receive_s = array_column($receive,'c_id');
... ...
... ... @@ -388,17 +388,20 @@ class User extends Api
$flag = config('verify.flag');
$where['uid'] = $this->uid;
$current_time = time();
if($is_flag == 0){
//未使用
$where['is_use'] = $flag[0];
$where1['end_time'] = ['>',time()];
$where1['start_time'] = ['<',$current_time];
$where1['end_time'] = ['>',$current_time];
}else if($is_flag == 1){
//已使用
$where['is_use'] = $flag[1];
$where1['end_time'] = ['>',time()];
$where1['start_time'] = ['<',$current_time];
$where1['end_time'] = ['>',$current_time];
}else{
//已过期
$where1['end_time'] = ['<',time()];
$where1['end_time'] = ['<',$current_time];
}
//查询已经领取过
... ...
... ... @@ -73,6 +73,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
{field: 'coupon_number', title: __('coupon_number'),operate:false},
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{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,operate:false},//排序
... ...
... ... @@ -71,6 +71,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
{field: 'coupon_number', title: __('Coupon_number'),operate:false},
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{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},//排序
... ...
... ... @@ -72,6 +72,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
{field: 'coupon_number', title: __('coupon_number'),operate:false},
{field: 'is_new', title: __('Is_new'),formatter: Table.api.formatter.label,searchList: {0: __('否'), 1: __('是')}},
{field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{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,operate:false},//排序
... ...