'上传接口文档'

This commit is contained in:
2020-08-21 16:31:23 +08:00
parent 60b1518028
commit 13d2ecf429
4 changed files with 28 additions and 17 deletions

1
README
View File

@@ -1 +1,2 @@
核销系统 增加发券

View File

@@ -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
*/
@@ -34,6 +36,7 @@ class CensusController extends AdminController
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;
}

Binary file not shown.