master
wangxinglong 2021-12-23 11:13:59 +08:00
parent 29847b2ad3
commit d4c18d3a63
3 changed files with 7 additions and 15 deletions

View File

@ -119,7 +119,6 @@ class Coupon extends Base
*/
public function info()
{
if ($this->request->isPost()) {
$model = new CouponMain();
$repo = CouponRepository::getInstance($model);

View File

@ -197,7 +197,7 @@ trait CouponMainTrait
$effectiveSize = CouponMain::where($whereMap)
->whereTime('start_time', '<=', date('Y-m-d H:i:s'))
->whereTime('end_time', '>=', date('Y-m-d H:i:s'))
->sum(Db::Raw('(`count` - `received_count`)'));
->sum(Db::raw('(`count` - `received_count`)'));
return [
// 发行总次数
@ -238,7 +238,9 @@ trait CouponMainTrait
->where($whereMap)
->when(MemberModel::is_agency($auth['roles'] ), function ($q)use($auth) {
$q->where('b.agency_code', '=', $auth['business_code']);
});
})
->field("a.*,b.business_name,b.business_subtitle")
;
$data["total"] = $rep->count();
$data["list"] = $rep->order($orders)->select();

View File

@ -46,18 +46,9 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate']
{field: 'id' , width: 80, title: 'ID'},
{field: 'name', title: '名称'},
{templet:function(d){
if( d.business != undefined ){
return d.business.business_name!=null?d.business.business_name:''
}
return d.business_name;
}, title: '所属商家'},
{templet:function(d){
if( d.business != undefined ){
return d.business.business_subtitle!=null?d.business.business_subtitle:''
}
return '';
}, title: '商家简称'},
{field: 'business_name', title: '所属商家'},
{field: 'business_subtitle', title: '商家简称'},
{field: 'agency_text', title: '渠道商名称'},
{field: 'money', title: '金额'},
{field: 'deduction_money', title: '扣费'},