去掉是否平安项目校验

This commit is contained in:
2020-09-02 11:29:02 +08:00
parent 5397d931f7
commit a18087bc6d
7 changed files with 22 additions and 26 deletions

View File

@@ -9,7 +9,8 @@ use Illuminate\Http\Request;
class Batch extends Action class Batch extends Action
{ {
public $name = '批量打款';
public $name = '批量打款';
protected $selector = '.import-post'; protected $selector = '.import-post';
@@ -31,18 +32,18 @@ class Batch extends Action
$error++; $error++;
} }
} }
return $this->response()->success("处理完成,成功:{$success}条,失败:{$error}")->refresh(); return $this->response()->success("处理完成,成功:{$success}条,失败:{$error}")->refresh();
} }
public function form() public function form()
{ {
$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') ->get()
->get() ->pluck('nickname', 'id');
->pluck('nickname', 'id');
$this->select('user_id', '渠道')->options($users)->required(); $this->select('user_id', '渠道')->options($users)->required();
// 时间日期选择 // 时间日期选择
@@ -55,4 +56,5 @@ class Batch extends Action
<a class="btn btn-sm btn-default import-post"><i class="fa fa-Yuan"></i>批量打款</a> <a class="btn btn-sm btn-default import-post"><i class="fa fa-Yuan"></i>批量打款</a>
HTML; HTML;
} }
} }

View File

@@ -20,7 +20,7 @@ class IndexController extends AdminController
'accountable', 'accountable',
User::class, User::class,
function ($query) { function ($query) {
$query->where('type', 'pingan')->whereHas('identity', function ($q) { $query->whereHas('identity', function ($q) {
$q->where('identity_id', 1); $q->where('identity_id', 1);
}); });
} }

View File

@@ -38,13 +38,10 @@ class IndexController extends AdminController
'3' => '核销失败', '3' => '核销失败',
]); ]);
$filter->between('created_at', '核销时间')->datetime(); $filter->between('created_at', '核销时间')->datetime();
$users = User::query() $users = User::whereHas('identity', function ($query) {
->whereHas('identity', function ($query) { $query->where('identity_id', 1);
$query->where('identity_id', 1); })->get()->pluck('nickname', 'id');
})
->where('type', 'pingan')
->get()
->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'));
}); });

View File

@@ -13,7 +13,7 @@ use Encore\Admin\Grid;
class IndexController extends AdminController class IndexController extends AdminController
{ {
protected $title = '平安渠道打款处理'; protected $title = '渠道打款处理';
/** /**
* Notes: * Notes:
@@ -59,7 +59,6 @@ class IndexController extends AdminController
->whereHas('identity', function ($query) { ->whereHas('identity', function ($query) {
$query->where('identity_id', 1); $query->where('identity_id', 1);
}) })
->where('type', 'pingan')
->get() ->get()
->pluck('nickname', 'id'); ->pluck('nickname', 'id');

View File

@@ -33,13 +33,10 @@ class LogController extends AdminController
$grid->filter(function ($filter) { $grid->filter(function ($filter) {
$filter->column(1 / 2, function ($filter) { $filter->column(1 / 2, function ($filter) {
$filter->between('paid_at', '打款时间')->datetime(); $filter->between('paid_at', '打款时间')->datetime();
$users = User::query() $users = User::whereHas('identity', function ($query) {
->whereHas('identity', function ($query) { $query->where('identity_id', 1);
$query->where('identity_id', 1); })->get()->pluck('nickname', 'id');
})
->where('type', 'pingan')
->get()
->pluck('nickname', 'id');
$filter->equal('user_id', '渠道')->select($users); $filter->equal('user_id', '渠道')->select($users);
}); });
$filter->column(1 / 2, function ($filter) { $filter->column(1 / 2, function ($filter) {

View File

@@ -43,7 +43,7 @@ class IndexController extends AdminController
$actions->add(new Callback); $actions->add(new Callback);
} }
if ($actions->row->type == 'pingan' && $actions->row->identity_id == 1 && $user->id == 1) { if ($actions->row->identity_id == 1 && $user->id == 1) {
$actions->add(new Profit); $actions->add(new Profit);
} }
}); });

View File

@@ -17,7 +17,7 @@ class User implements ToCollection
foreach ($rows as $row) { foreach ($rows as $row) {
$user = UserModel::whereHas('info', function ($q) use ($row) { $user = UserModel::whereHas('info', function ($q) use ($row) {
$q->where('nickname', $row[1]); $q->where('nickname', $row[1]);
})->where('type', 'pingan')->whereNull('PaOutletId')->first(); })->whereNull('PaOutletId')->first();
if ($user) { if ($user) {
$user->PaOutletId = $row[2]; $user->PaOutletId = $row[2];
@@ -29,6 +29,7 @@ class User implements ToCollection
if (count($error) > 0) { if (count($error) > 0) {
dd($error); dd($error);
return implode(' ,', $error); return implode(' ,', $error);
} }