添加用户列表,售后显示用户昵称
parent
7c87db03b1
commit
11c1f93e56
|
|
@ -31,7 +31,7 @@ class AfterSaleController extends AdminController
|
||||||
*/
|
*/
|
||||||
protected function grid()
|
protected function grid()
|
||||||
{
|
{
|
||||||
$builder = AfterSale::with(['user', 'order', 'orderProduct', 'tags']);
|
$builder = AfterSale::with(['user', 'user.userInfo', 'order', 'orderProduct', 'tags']);
|
||||||
|
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
$orderProductId = Request::query('order_product_id', 0);
|
$orderProductId = Request::query('order_product_id', 0);
|
||||||
|
|
@ -48,6 +48,7 @@ class AfterSaleController extends AdminController
|
||||||
return $array;
|
return $array;
|
||||||
})->label();
|
})->label();
|
||||||
$grid->column('user.phone')->copyable();
|
$grid->column('user.phone')->copyable();
|
||||||
|
$grid->column('user.userInfo.nickname');
|
||||||
$grid->column('order.sn')->if(function () {
|
$grid->column('order.sn')->if(function () {
|
||||||
return Admin::user()->can('dcat.admin.orders.show');
|
return Admin::user()->can('dcat.admin.orders.show');
|
||||||
})
|
})
|
||||||
|
|
@ -123,16 +124,14 @@ class AfterSaleController extends AdminController
|
||||||
{
|
{
|
||||||
return function (Row $row) use ($id) {
|
return function (Row $row) use ($id) {
|
||||||
$row->column(4, function ($column) use ($id) {
|
$row->column(4, function ($column) use ($id) {
|
||||||
$builder = AfterSale::with(['user', 'order', 'orderProduct', 'tags']);
|
$builder = AfterSale::with(['user', 'user.userInfo', 'order', 'orderProduct', 'tags']);
|
||||||
$column->row(Show::make($id, $builder, function (Show $show) {
|
$column->row(Show::make($id, $builder, function (Show $show) {
|
||||||
$show->field('id');
|
$show->field('id');
|
||||||
$show->field('sn');
|
$show->field('sn');
|
||||||
$show->field('order.sn');
|
$show->field('order.sn');
|
||||||
$show->field('user.phone');
|
$show->field('user.phone');
|
||||||
|
$show->field('user.user_info.nickname');
|
||||||
$show->field('order_product.name');
|
$show->field('order_product.name');
|
||||||
$show->field('tags')->as(function () {
|
|
||||||
return $this->tags->pluck('name');
|
|
||||||
})->label();
|
|
||||||
$show->field('num');
|
$show->field('num');
|
||||||
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND])) {
|
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND])) {
|
||||||
$show->field('amount')->as(function ($amount) {
|
$show->field('amount')->as(function ($amount) {
|
||||||
|
|
@ -157,6 +156,9 @@ class AfterSaleController extends AdminController
|
||||||
AfterSaleModel::STATE_FINISH=>'success',
|
AfterSaleModel::STATE_FINISH=>'success',
|
||||||
AfterSaleModel::STATE_CANCEL=>'#b3b9bf',
|
AfterSaleModel::STATE_CANCEL=>'#b3b9bf',
|
||||||
]);
|
]);
|
||||||
|
$show->field('tags')->as(function () {
|
||||||
|
return $this->tags->pluck('name');
|
||||||
|
})->label();
|
||||||
// $show->field('order_product.cover')->image();
|
// $show->field('order_product.cover')->image();
|
||||||
$show->field('created_at');
|
$show->field('created_at');
|
||||||
$show->field('updated_at');
|
$show->field('updated_at');
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class UserController extends AdminController
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
// $grid->column('id')->sortable();
|
// $grid->column('id')->sortable();
|
||||||
$grid->column('phone')->copyable();
|
$grid->column('phone')->copyable();
|
||||||
|
$grid->column('userInfo.nickname');
|
||||||
|
|
||||||
$grid->column('userInfo.agent_level')->display(function ($value) {
|
$grid->column('userInfo.agent_level')->display(function ($value) {
|
||||||
return $this->userInfo?->agent_level_name??'未知';
|
return $this->userInfo?->agent_level_name??'未知';
|
||||||
})->label();
|
})->label();
|
||||||
|
|
@ -144,6 +146,7 @@ class UserController extends AdminController
|
||||||
$column->row(Show::make($id, $builder, function (Show $show) {
|
$column->row(Show::make($id, $builder, function (Show $show) {
|
||||||
$show->field('id');
|
$show->field('id');
|
||||||
$show->field('phone');
|
$show->field('phone');
|
||||||
|
$show->field('user_info.nickname');
|
||||||
$show->field('user_info.agent_level')->as(function ($value) {
|
$show->field('user_info.agent_level')->as(function ($value) {
|
||||||
return $this->userInfo?->agent_level_name??'未知';
|
return $this->userInfo?->agent_level_name??'未知';
|
||||||
})->label();
|
})->label();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,12 @@ return [
|
||||||
'user_id' => '用户ID',
|
'user_id' => '用户ID',
|
||||||
'user'=>[
|
'user'=>[
|
||||||
'phone' => '手机号',
|
'phone' => '手机号',
|
||||||
|
'userInfo' => [
|
||||||
|
'nickname' => '昵称',
|
||||||
|
],
|
||||||
|
'user_info'=>[
|
||||||
|
'nickname' => '昵称',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'order_id' => '原订单ID',
|
'order_id' => '原订单ID',
|
||||||
'order'=>[
|
'order'=>[
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ return [
|
||||||
],
|
],
|
||||||
'userInfo'=>[
|
'userInfo'=>[
|
||||||
'avatar' => '头像',
|
'avatar' => '头像',
|
||||||
|
'nickname' => '昵称',
|
||||||
'agent_level'=>'管理级别',
|
'agent_level'=>'管理级别',
|
||||||
'growth_value'=>'消费值',
|
'growth_value'=>'消费值',
|
||||||
'group_sales_value'=>'业绩',
|
'group_sales_value'=>'业绩',
|
||||||
|
|
@ -34,6 +35,7 @@ return [
|
||||||
],
|
],
|
||||||
'user_info'=>[
|
'user_info'=>[
|
||||||
'avatar' => '头像',
|
'avatar' => '头像',
|
||||||
|
'nickname' => '昵称',
|
||||||
'agent_level'=>'管理级别',
|
'agent_level'=>'管理级别',
|
||||||
'growth_value'=>'消费值',
|
'growth_value'=>'消费值',
|
||||||
'group_sales_value'=>'业绩',
|
'group_sales_value'=>'业绩',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue