diff --git a/app/controller/manager/Coupon.php b/app/controller/manager/Coupon.php index 0bc7687..fab87a6 100644 --- a/app/controller/manager/Coupon.php +++ b/app/controller/manager/Coupon.php @@ -119,7 +119,6 @@ class Coupon extends Base */ public function info() { - if ($this->request->isPost()) { $model = new CouponMain(); $repo = CouponRepository::getInstance($model); diff --git a/app/traits/CouponMainTrait.php b/app/traits/CouponMainTrait.php index 104bb29..826d941 100644 --- a/app/traits/CouponMainTrait.php +++ b/app/traits/CouponMainTrait.php @@ -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(); diff --git a/public/static/manager/js/coupon/index.js b/public/static/manager/js/coupon/index.js index 197134a..5908470 100644 --- a/public/static/manager/js/coupon/index.js +++ b/public/static/manager/js/coupon/index.js @@ -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: '扣费'},