6
0
Fork 0

调整商城等级文字

release
vine_liutk 2022-02-25 16:33:06 +08:00
parent d706b14456
commit b8fdcde922
6 changed files with 184 additions and 176 deletions

View File

@ -136,12 +136,14 @@ class AfterSaleController extends AdminController
protected function detail($id) protected function detail($id)
{ {
return function (Row $row) use ($id) { return function (Row $row) use ($id) {
$row->column(4, function ($column) use ($id) { $row->column(5, function ($column) use ($id) {
$builder = AfterSale::with(['user', 'user.userInfo', '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'); $type = $show->model()->type;
$show->field('order.sn', '售后订单')->unescape()->as(function ($value) { $show->row(function (Show\Row $show) use ($type) {
$show->width(6)->field('sn');
$show->field('order.sn', '关联订单编号')->unescape()->as(function ($value) {
if (Admin::user()->can('dcat.admin.orders.show')) { if (Admin::user()->can('dcat.admin.orders.show')) {
return '<a href="'.admin_route('orders.show', ['order'=>$this->order]).'" target="_blank">'.$value.'</a>'; return '<a href="'.admin_route('orders.show', ['order'=>$this->order]).'" target="_blank">'.$value.'</a>';
} }
@ -151,18 +153,26 @@ class AfterSaleController extends AdminController
return $value.'*'. $this->num; return $value.'*'. $this->num;
}); });
// $show->field('num'); // $show->field('num');
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND])) { if (in_array($type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND])) {
$show->field('amount', '售后金额')->as(function ($amount) { $show->field('amount', '售后金额')->as(function ($amount) {
return '¥'.bcdiv($amount, 100, 2); return '¥'.bcdiv($amount, 100, 2);
}); });
} }
$show->width(6)->field('user.user_info.nickname', '下单用户');
$show->field('user.phone');
$show->field('type')->using([ $show->field('type')->using([
AfterSaleModel::TYPE_REFUND_AND_RETURN => '退款退货', AfterSaleModel::TYPE_REFUND_AND_RETURN => '退款退货',
AfterSaleModel::TYPE_REFUND => '退款', AfterSaleModel::TYPE_REFUND => '退款',
AfterSaleModel::TYPE_CHANGE => '换货', AfterSaleModel::TYPE_CHANGE => '换货',
AfterSaleModel::TYPE_FILL => '漏发', AfterSaleModel::TYPE_FILL => '漏发',
])->label(); ])->label();
$show->field('state')->using(AfterSaleModel::$stateText)->dot([ if (in_array($type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND, AfterSaleModel::TYPE_CHANGE])) {
$show->field('sales_value', '销售值');
}
});
$status = $stae = $show->model()->state;
$show->row(function (Show\Row $show) use ($type, $status) {
$show->width(6)->field('state')->using(AfterSaleModel::$stateText)->dot([
AfterSaleModel::STATE_APPLY=>'warning', AfterSaleModel::STATE_APPLY=>'warning',
AfterSaleModel::STATE_VERIFY=>'danger', AfterSaleModel::STATE_VERIFY=>'danger',
AfterSaleModel::STATE_AGREE=>'warning', AfterSaleModel::STATE_AGREE=>'warning',
@ -171,21 +181,21 @@ class AfterSaleController extends AdminController
AfterSaleModel::STATE_FINISH=>'success', AfterSaleModel::STATE_FINISH=>'success',
AfterSaleModel::STATE_CANCEL=>'#b3b9bf', AfterSaleModel::STATE_CANCEL=>'#b3b9bf',
]); ]);
$show->field('user.user_info.nickname', '下单用户'); if (in_array($type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_CHANGE]) && in_array($status, [
$show->field('user.phone'); AfterSaleModel::STATE_SHIPPING, AfterSaleModel::STATE_FINANCE, AfterSaleModel::STATE_FINISH,
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_CHANGE])) { ])) {
$show->field('tracking_number'); $show->field('tracking_number');
} }
});
$show->field('tags')->as(function () { $show->row(function (Show\Row $show) use ($type, $status) {
$show->width(12)->field('tags')->width(10, 1)->as(function () {
return $this->tags->pluck('name'); return $this->tags->pluck('name');
})->label(); })->label();
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND, AfterSaleModel::TYPE_CHANGE])) { $show->width(6)->field('created_at');
$show->field('sales_value', '销售值');
}
// $show->field('order_product.cover')->image();
$show->field('created_at');
$show->field('updated_at'); $show->field('updated_at');
});
// $show->field('order_product.cover')->image();
$show->panel() $show->panel()
->tools(function (Show\Tools $tools) use ($show) { ->tools(function (Show\Tools $tools) use ($show) {
$tools->disableEdit(); $tools->disableEdit();
@ -214,7 +224,7 @@ class AfterSaleController extends AdminController
}); });
})); }));
}); });
$row->column(8, function ($column) use ($id) { $row->column(7, function ($column) use ($id) {
$afterSale = AfterSaleModel::findOrFail($id); $afterSale = AfterSaleModel::findOrFail($id);
$builder = AfterSaleModel::with('orderProduct')->where('order_product_id', $afterSale?->order_product_id)->where('id', '<>', $id); $builder = AfterSaleModel::with('orderProduct')->where('order_product_id', $afterSale?->order_product_id)->where('id', '<>', $id);
$column->row(Box::make('相关售后', Grid::make($builder, function (Grid $grid) { $column->row(Box::make('相关售后', Grid::make($builder, function (Grid $grid) {

View File

@ -154,7 +154,8 @@ class OrderController extends AdminController
$builder = OrderModel::with(['user', 'userCoupon', 'tags'])->withCount('afterSales'); $builder = OrderModel::with(['user', 'userCoupon', 'tags'])->withCount('afterSales');
$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->row(function (Show\Row $show) {
$show->width(6)->field('sn');
$show->field('order_status')->as(function ($v) { $show->field('order_status')->as(function ($v) {
return $this->order_status; return $this->order_status;
})->using([ })->using([
@ -172,50 +173,38 @@ class OrderController extends AdminController
9=>'success', 9=>'success',
10=>'#b3b9bf', 10=>'#b3b9bf',
]); ]);
$show->field('total_amount')->as(function ($v) {
return bcdiv($v, 100, 2);
})->prepend('¥');
$show->field('created_at'); $show->field('created_at');
$show->html(function () { $show->width(6)->field('tags')->as(function () {
return $this->tags->pluck('name');
})->label();
$show->field('pay_at');
$show->field('pay_way')->unescape()->as(function () {
$content = ''; $content = '';
if ($this->pay_way) { if ($this->pay_way) {
$content = '<i class="fa fa-circle" style="font-size: 13px;color: '.$this->pay_way->color().'"></i>&nbsp;&nbsp;'.$this->pay_way->getMallOrderText(); $content = '<i class="fa fa-circle" style="font-size: 13px;color: '.$this->pay_way->color().'"></i>&nbsp;&nbsp;'.$this->pay_way->getMallOrderText();
} }
return <<<HTML return $content;
<div class="show-field form-group row">
<div class="col-sm-2 control-label">
<span>支付方式</span>
</div>
<div class="col-sm-8">
<div class="box box-solid box-default no-margin box-show">
<div class="box-body">{$content}&nbsp;</div>
</div>
</div>
</div>
HTML;
}); });
$show->field('pay_at'); });
$show->field('tags')->as(function () { $show->row(function (Show\Row $show) {
return $this->tags->pluck('name'); $show->width(6)->field('consignee_name');
})->label();
$show->divider();
$show->field('consignee_name');
$show->field('consignee_telephone'); $show->field('consignee_telephone');
$show->field('consignee')->as(function () { $show->width(12)->field('consignee')->width(10, 1)->as(function () {
return $this->consignee_zone . ' '. $this->consignee_address; return $this->consignee_zone . ' '. $this->consignee_address;
}); });
// $show->field('user.phone'); });
$show->divider(); $userCouponId = $show->model()->user_coupon_id;
$show->field('products_total_amount')->as(function ($v) { $show->row(function (Show\Row $show) use ($userCouponId) {
$show->width(6)->field('products_total_amount')->as(function ($v) {
return bcdiv($v, 100, 2); return bcdiv($v, 100, 2);
})->prepend('¥'); })->prepend('¥');
$show->field('vip_discount_amount')->as(function ($v) { $show->field('vip_discount_amount')->as(function ($v) {
return bcdiv($v, 100, 2); return bcdiv($v, 100, 2);
})->prepend('- ¥'); })->prepend('- ¥');
if ($show->model()->user_coupon_id) { if ($userCouponId) {
$show->field('user_coupon.coupon_name', '优惠券')->label(); $show->field('user_coupon.coupon_name', '优惠券')->label();
$show->field('coupon_discount_amount')->as(function ($v) { $show->field('coupon_discount_amount')->as(function ($v) {
return bcdiv($v, 100, 2); return bcdiv($v, 100, 2);
@ -227,8 +216,12 @@ HTML;
$show->field('reduced_amount')->as(function ($v) { $show->field('reduced_amount')->as(function ($v) {
return bcdiv($v, 100, 2); return bcdiv($v, 100, 2);
})->prepend('- ¥'); })->prepend('- ¥');
$show->divider(); $show->field('total_amount')->as(function ($v) {
$show->field('sales_value', '总销售值'); return bcdiv($v, 100, 2);
})->prepend('¥');
});
$show->row(function (Show\Row $show) use ($userCouponId) {
$show->width(6)->field('sales_value', '总销售值');
$show->field('is_settle', '是否结算')->using([ $show->field('is_settle', '是否结算')->using([
0=>'未结算', 0=>'未结算',
1=>'已结算', 1=>'已结算',
@ -237,9 +230,9 @@ HTML;
1=>'success', 1=>'success',
]); ]);
$show->field('completed_at', '完成时间'); $show->field('completed_at', '完成时间');
$show->divider(); $show->width(12)->field('note')->width(10, 1);
$show->field('note'); $show->width(12)->field('remark')->width(10, 1);
$show->field('remark'); });
$show->panel() $show->panel()
->tools(function (Show\Tools $tools) use ($show) { ->tools(function (Show\Tools $tools) use ($show) {

View File

@ -170,15 +170,17 @@ class UserController extends AdminController
$row->column(5, function ($column) use ($id) { $row->column(5, function ($column) use ($id) {
$builder = User::with(['userInfo', 'wallet', 'balance', 'userInfo.inviterInfo.user']); $builder = User::with(['userInfo', 'wallet', 'balance', 'userInfo.inviterInfo.user']);
$column->row(Show::make($id, $builder, function (Show $show) { $column->row(Show::make($id, $builder, function (Show $show) {
$show->field('id'); $show->row(function (Show\Row $show) {
$show->field('phone'); $show->width(12)->field('id')->width(10, 1);
$show->width(6)->field('phone');
$show->field('user_info.inviter_info.user.phone');
$show->field('user_info.nickname'); $show->field('user_info.nickname');
$show->field('user_info.gender')->using(UserInfo::$genderTexts)->label(); $show->field('user_info.gender')->using(UserInfo::$genderTexts)->label();
$show->field('user_info.birthday'); $show->field('user_info.birthday');
$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();
$show->field('user_info.inviter_info.user.phone');
$show->field('user_info.growth_value'); $show->field('user_info.growth_value');
$show->field('user_info.group_sales_value'); $show->field('user_info.group_sales_value');
@ -193,11 +195,14 @@ class UserController extends AdminController
$show->field('user_info.quota_v2'); $show->field('user_info.quota_v2');
$show->field('user_info.quota_v1'); $show->field('user_info.quota_v1');
$show->field('user_info.points'); $show->field('user_info.points');
});
$show->field('last_login_ip'); $show->row(function (Show\Row $show) {
$show->width(6)->field('last_login_ip');
$show->field('last_login_at'); $show->field('last_login_at');
$show->field('register_ip'); $show->field('register_ip');
$show->field('created_at'); $show->field('created_at');
});
$show->panel() $show->panel()
->tools(function ($tools) use ($show) { ->tools(function ($tools) use ($show) {
$tools->disableEdit(); $tools->disableEdit();

View File

@ -140,7 +140,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-warning"></i> <i class="fa fa-circle-o text-bold-700 text-warning"></i>
<span class="text-bold-600 ml-50">店铺</span> <span class="text-bold-600 ml-50">会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$vip}</span> <span>{$vip}</span>
@ -149,7 +149,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-danger"></i> <i class="fa fa-circle-o text-bold-700 text-danger"></i>
<span class="text-bold-600 ml-50">社区</span> <span class="text-bold-600 ml-50">铁牌会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$community}</span> <span>{$community}</span>
@ -158,7 +158,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1" > <div class="chart-info d-flex justify-content-between mb-1" >
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-info"></i> <i class="fa fa-circle-o text-bold-700 text-info"></i>
<span class="text-bold-600 ml-50">区级</span> <span class="text-bold-600 ml-50">铜牌会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$district}</span> <span>{$district}</span>
@ -168,7 +168,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-primary"></i> <i class="fa fa-circle-o text-bold-700 text-primary"></i>
<span class="text-bold-600 ml-50">市级</span> <span class="text-bold-600 ml-50">银牌会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$city}</span> <span>{$city}</span>
@ -178,7 +178,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-warning"></i> <i class="fa fa-circle-o text-bold-700 text-warning"></i>
<span class="text-bold-600 ml-50">省级</span> <span class="text-bold-600 ml-50">金牌会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$province}</span> <span>{$province}</span>
@ -187,7 +187,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-danger"></i> <i class="fa fa-circle-o text-bold-700 text-danger"></i>
<span class="text-bold-600 ml-50">分公司</span> <span class="text-bold-600 ml-50">钻石会员</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$branch}</span> <span>{$branch}</span>
@ -196,7 +196,7 @@ class Users extends Donut
<div class="chart-info d-flex justify-content-between mb-1"> <div class="chart-info d-flex justify-content-between mb-1">
<div class="series-info d-flex align-items-center"> <div class="series-info d-flex align-items-center">
<i class="fa fa-circle-o text-bold-700 text-info"></i> <i class="fa fa-circle-o text-bold-700 text-info"></i>
<span class="text-bold-600 ml-50">董事</span> <span class="text-bold-600 ml-50">默认用户</span>
</div> </div>
<div class="product-result"> <div class="product-result">
<span>{$director}</span> <span>{$director}</span>

View File

@ -34,7 +34,7 @@ class AgentController extends Controller
], ],
// 代理 // 代理
'agents_count' => [ 'agents_count' => [
'label' => '店铺', 'label' => '会员',
'current_agents_count' => $userInfo->getVipAgentsCount(), 'current_agents_count' => $userInfo->getVipAgentsCount(),
'upgrade_agents_count' => $rules['community']['vips_agents_count'], 'upgrade_agents_count' => $rules['community']['vips_agents_count'],
], ],
@ -50,7 +50,7 @@ class AgentController extends Controller
'upgrade_team_sales_value' => (string) $rules['district']['team_sales_value'], 'upgrade_team_sales_value' => (string) $rules['district']['team_sales_value'],
], ],
'agents_count' => [ 'agents_count' => [
'label' => '店铺', 'label' => '会员',
'current_agents_count' => $userInfo->getVipAgentsCount(), 'current_agents_count' => $userInfo->getVipAgentsCount(),
'upgrade_agents_count' => $rules['district']['vips_agents_count'], 'upgrade_agents_count' => $rules['district']['vips_agents_count'],
], ],
@ -66,7 +66,7 @@ class AgentController extends Controller
'upgrade_team_sales_value' => (string) $rules['city']['team_sales_value'], 'upgrade_team_sales_value' => (string) $rules['city']['team_sales_value'],
], ],
'agents_count' => [ 'agents_count' => [
'label' => '区代', 'label' => '铜牌会员',
'current_agents_count' => $userInfo->getDistrictAgentsCountOnDifferentLines(), 'current_agents_count' => $userInfo->getDistrictAgentsCountOnDifferentLines(),
'upgrade_agents_count' => $rules['city']['district_agents_count'], 'upgrade_agents_count' => $rules['city']['district_agents_count'],
], ],
@ -82,7 +82,7 @@ class AgentController extends Controller
'upgrade_team_sales_value' => (string) $rules['province']['team_sales_value'], 'upgrade_team_sales_value' => (string) $rules['province']['team_sales_value'],
], ],
'agents_count' => [ 'agents_count' => [
'label' => '市代', 'label' => '银牌会员',
'current_agents_count' => $userInfo->getCityAgentsCountOnDifferentLines(), 'current_agents_count' => $userInfo->getCityAgentsCountOnDifferentLines(),
'upgrade_agents_count' => $rules['province']['city_agents_count'], 'upgrade_agents_count' => $rules['province']['city_agents_count'],
], ],
@ -98,7 +98,7 @@ class AgentController extends Controller
'upgrade_team_sales_value' => (string) $rules['branch']['team_sales_value'], 'upgrade_team_sales_value' => (string) $rules['branch']['team_sales_value'],
], ],
'agents_count' => [ 'agents_count' => [
'label' => '省代', 'label' => '金牌会员',
'current_agents_count' => $userInfo->getProvinceAgentsCountOnDifferentLines(), 'current_agents_count' => $userInfo->getProvinceAgentsCountOnDifferentLines(),
'upgrade_agents_count' => $rules['branch']['province_agents_count'], 'upgrade_agents_count' => $rules['branch']['province_agents_count'],
], ],

View File

@ -116,13 +116,13 @@ class UserInfo extends Model
*/ */
public static $agentLevelTexts = [ public static $agentLevelTexts = [
self::AGENT_LEVEL_CIVILIAN => '粉丝', self::AGENT_LEVEL_CIVILIAN => '粉丝',
self::AGENT_LEVEL_VIP => '店铺', self::AGENT_LEVEL_VIP => '会员',
self::AGENT_LEVEL_COMMUNITY => '社区', self::AGENT_LEVEL_COMMUNITY => '铁牌会员',
self::AGENT_LEVEL_DISTRICT => '区级', self::AGENT_LEVEL_DISTRICT => '铜牌会员',
self::AGENT_LEVEL_CITY => '市级', self::AGENT_LEVEL_CITY => '银牌会员',
self::AGENT_LEVEL_PROVINCE => '省级', self::AGENT_LEVEL_PROVINCE => '金牌会员',
self::AGENT_LEVEL_BRANCH => '分公司', self::AGENT_LEVEL_BRANCH => '钻石会员',
self::AGENT_LEVEL_DIRECTOR => '董事', self::AGENT_LEVEL_DIRECTOR => '默认用户',
]; ];
/** /**