diff --git a/README b/README index eead118..438e0bc 100644 --- a/README +++ b/README @@ -1 +1,2 @@ -核销系统 增加发券 \ No newline at end of file +核销系统 增加发券 + diff --git a/app/Admin/Controllers/Finance/CensusController.php b/app/Admin/Controllers/Finance/CensusController.php index 6193716..a62e723 100644 --- a/app/Admin/Controllers/Finance/CensusController.php +++ b/app/Admin/Controllers/Finance/CensusController.php @@ -2,6 +2,8 @@ namespace App\Admin\Controllers\Finance; +use App\Models\AccountRule; +use App\Models\ActivityRule; use App\Models\User; use Encore\Admin\Controllers\AdminController; use Encore\Admin\Facades\Admin; @@ -10,11 +12,11 @@ use Encore\Admin\Layout\Content; class CensusController extends AdminController { + protected $today = false; /** * Index interface. - * * @param Content $content * @return Content */ @@ -28,12 +30,13 @@ class CensusController extends AdminController /** * 今日核销数据 - * @param Content $content [description] + * @param Content $content [description] * @return [type] [description] */ public function today(Content $content) { $this->today = true; + return $content ->header('核销今日数据') ->description('description') @@ -65,22 +68,29 @@ class CensusController extends AdminController $grid->column('渠道')->display(function () { return $this->info->nickname; }); + $today = $this->today; + $rules = ActivityRule::get(); - $grid->column('100元减10元优惠券')->display(function () use ($today) { - return $this->getCouponCount('YSD-full100-10', $today); - }); - - $grid->column('100元减25元优惠券')->display(function () use ($today) { - return $this->getCouponCount('YSD-full100-25', $today); - }); - $grid->column('100元减50元优惠券')->display(function () use ($today) { - return $this->getCouponCount('YSD-full100-50', $today); - }); - - $grid->column(' 200元减100元优惠券')->display(function () use ($today) { - return $this->getCouponCount('YSD-full200-100', $today); - }); + foreach ($rules as $rule) { + $grid->column($rule->title)->display(function () use ($today, $rule) { + return $this->getCouponCount($rule->code, $today); + }); + } + // $grid->column('100元减10元优惠券')->display(function () use ($today) { + // return $this->getCouponCount('YSD-full100-10', $today); + // }); + // + // $grid->column('100元减25元优惠券')->display(function () use ($today) { + // return $this->getCouponCount('YSD-full100-25', $today); + // }); + // $grid->column('100元减50元优惠券')->display(function () use ($today) { + // return $this->getCouponCount('YSD-full100-50', $today); + // }); + // + // $grid->column(' 200元减100元优惠券')->display(function () use ($today) { + // return $this->getCouponCount('YSD-full200-100', $today); + // }); return $grid; } diff --git a/docs/亿时代平安券码渠道接口说明文档.docx b/docs/亿时代平安券码渠道接口说明文档.docx new file mode 100644 index 0000000..4251252 Binary files /dev/null and b/docs/亿时代平安券码渠道接口说明文档.docx differ diff --git a/docs/亿时代自有券码接口说明文档.docx b/docs/亿时代自有券码接口说明文档.docx new file mode 100644 index 0000000..feb6db0 Binary files /dev/null and b/docs/亿时代自有券码接口说明文档.docx differ