一点小修改
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Admin\Controllers\Coupon;
|
namespace App\Admin\Controllers\Coupon;
|
||||||
|
|
||||||
use App\Admin\Exporters\CouponExport;
|
|
||||||
use App\Models\ActivityRule;
|
use App\Models\ActivityRule;
|
||||||
use App\Models\Coupon;
|
use App\Models\Coupon;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@@ -37,12 +36,12 @@ class IndexController extends AdminController
|
|||||||
]);
|
]);
|
||||||
$filter->between('created_at', '核销时间')->datetime();
|
$filter->between('created_at', '核销时间')->datetime();
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->whereHas('identity', function ($query) {
|
->whereHas('identity', function ($query) {
|
||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})
|
})
|
||||||
->where('type', 'pingan')
|
->where('type', 'pingan')
|
||||||
->get()
|
->get()
|
||||||
->pluck('nickname', 'id');
|
->pluck('nickname', 'id');
|
||||||
$filter->equal('user_id', '渠道')->select($users);
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
||||||
});
|
});
|
||||||
@@ -65,11 +64,11 @@ class IndexController extends AdminController
|
|||||||
return $this->user->nickname;
|
return $this->user->nickname;
|
||||||
});
|
});
|
||||||
$grid->column('type', '类型')
|
$grid->column('type', '类型')
|
||||||
->using(Coupon::TYPES)
|
->using(Coupon::TYPES)
|
||||||
->label([
|
->label([
|
||||||
'1' => 'info',
|
'1' => 'info',
|
||||||
'2' => 'success',
|
'2' => 'success',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$grid->column('网点名称/编号')->display(function () {
|
$grid->column('网点名称/编号')->display(function () {
|
||||||
return $this->outlet ? $this->outlet->nickname : $this->outletId;
|
return $this->outlet ? $this->outlet->nickname : $this->outletId;
|
||||||
@@ -119,13 +118,13 @@ class IndexController extends AdminController
|
|||||||
$pass = collect($pass);
|
$pass = collect($pass);
|
||||||
|
|
||||||
return '<label class="label label-success">全部:' . $all->count() . '张</label> '
|
return '<label class="label label-success">全部:' . $all->count() . '张</label> '
|
||||||
. '<label class="label label-success">成功:' . $pass->count() . '张</label> '
|
. '<label class="label label-success">成功:' . $pass->count() . '张</label> '
|
||||||
. '<label class="label label-success">失败:' . $all->where('status', 3)
|
. '<label class="label label-success">失败:' . $all->where('status', 3)
|
||||||
->count() . '张</label> '
|
->count() . '张</label> '
|
||||||
. '<label class="label label-success">核销金额:' . $pass->sum('price') . '元</label> '
|
. '<label class="label label-success">核销金额:' . $pass->sum('price') . '元</label> '
|
||||||
. '<label class="label label-success">资金通道结算:' . $pass->sum('profit') . '元</label> '
|
. '<label class="label label-success">资金通道结算:' . $pass->sum('profit') . '元</label> '
|
||||||
. '<label class="label label-success">打款金额:' . $pass->where('is_profit', 1)
|
. '<label class="label label-success">打款金额:' . $pass->where('is_profit', 1)
|
||||||
->sum('profit') . '元</label> ';
|
->sum('profit') . '元</label> ';
|
||||||
});
|
});
|
||||||
$grid->disableExport(false);
|
$grid->disableExport(false);
|
||||||
|
|
||||||
@@ -163,30 +162,30 @@ class IndexController extends AdminController
|
|||||||
$form->decimal('recommend', '推荐人佣金')->required()->default(0);
|
$form->decimal('recommend', '推荐人佣金')->required()->default(0);
|
||||||
$form->number('hots', '热度/亲密度')->required()->default('1');
|
$form->number('hots', '热度/亲密度')->required()->default('1');
|
||||||
$form->text('times', '显示时间')
|
$form->text('times', '显示时间')
|
||||||
->default('200')
|
->default('200')
|
||||||
->required()
|
->required()
|
||||||
->help('礼物显示时间,毫秒');
|
->help('礼物显示时间,毫秒');
|
||||||
|
|
||||||
$form->textarea('description', '礼物说明');
|
$form->textarea('description', '礼物说明');
|
||||||
|
|
||||||
$form->image('cover', '封面')
|
$form->image('cover', '封面')
|
||||||
->rules(function ($form) {
|
->rules(function ($form) {
|
||||||
if ($form->model()->cover != '') {
|
if ($form->model()->cover != '') {
|
||||||
return 'nullable|image';
|
return 'nullable|image';
|
||||||
} else {
|
} else {
|
||||||
return 'required';
|
return 'required';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->move('images/' . date('Y/m/d'))
|
->move('images/' . date('Y/m/d'))
|
||||||
->removable()
|
->removable()
|
||||||
->uniqueName();
|
->uniqueName();
|
||||||
|
|
||||||
$form->switch('status', '状态')->default(1);
|
$form->switch('status', '状态')->default(1);
|
||||||
$form->decimal('sort', '排序')->default(0)->help('序号越大越靠前');
|
$form->decimal('sort', '排序')->default(0)->help('序号越大越靠前');
|
||||||
|
|
||||||
$form->saving(function ($form) {
|
$form->saving(function ($form) {
|
||||||
$sum = (int)$form->pv + (int)$form->bonus + (int)$form->recommend;
|
$sum = (int) $form->pv + (int) $form->bonus + (int) $form->recommend;
|
||||||
if ((int)$sum > $form->price) {
|
if ((int) $sum > $form->price) {
|
||||||
admin_warning('配置错误', 'PV+佣金+推荐人佣金不能超过礼物价值');
|
admin_warning('配置错误', 'PV+佣金+推荐人佣金不能超过礼物价值');
|
||||||
throw new \Exception('配置错误,PV+佣金+推荐人佣金不能超过礼物价值');
|
throw new \Exception('配置错误,PV+佣金+推荐人佣金不能超过礼物价值');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class UserController extends Controller
|
|||||||
'redemptionCode' => 'required',
|
'redemptionCode' => 'required',
|
||||||
'total' => 'required',
|
'total' => 'required',
|
||||||
'outletId' => 'required',
|
'outletId' => 'required',
|
||||||
'orderid' => 'nullable|min:10',
|
// 'orderid' => 'nullable|min:100',
|
||||||
], [
|
], [
|
||||||
'redemptionCode.required' => '缺少卡券兑换码',
|
'redemptionCode.required' => '缺少卡券兑换码',
|
||||||
'total.required' => '缺少订单总额',
|
'total.required' => '缺少订单总额',
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
echo phpinfo();
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Register The Auto Loader
|
| Register The Auto Loader
|
||||||
|
|||||||
Reference in New Issue
Block a user