调整后台内容显示
parent
44a4979228
commit
2fda9e3733
|
|
@ -140,24 +140,21 @@ class AfterSaleController extends AdminController
|
|||
$column->row(Show::make($id, $builder, function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('sn');
|
||||
$show->field('order.sn')->unescape()->as(function ($value) {
|
||||
$show->field('order.sn', '售后订单')->unescape()->as(function ($value) {
|
||||
if (Admin::user()->can('dcat.admin.orders.show')) {
|
||||
return '<a href="'.admin_route('orders.show', ['order'=>$this->order]).'" target="_blank">'.$value.'</a>';
|
||||
}
|
||||
return $value;
|
||||
});
|
||||
$show->field('user.phone');
|
||||
$show->field('user.user_info.nickname');
|
||||
$show->field('order_product.name');
|
||||
$show->field('num');
|
||||
$show->field('order_product.name', '售后商品')->as(function ($value) {
|
||||
return $value.'*'. $this->num;
|
||||
});
|
||||
// $show->field('num');
|
||||
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) {
|
||||
return '¥'.bcdiv($amount, 100, 2);
|
||||
});
|
||||
}
|
||||
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_CHANGE])) {
|
||||
$show->field('tracking_number');
|
||||
}
|
||||
$show->field('type')->using([
|
||||
AfterSaleModel::TYPE_REFUND_AND_RETURN => '退款退货',
|
||||
AfterSaleModel::TYPE_REFUND => '退款',
|
||||
|
|
@ -173,9 +170,18 @@ class AfterSaleController extends AdminController
|
|||
AfterSaleModel::STATE_FINISH=>'success',
|
||||
AfterSaleModel::STATE_CANCEL=>'#b3b9bf',
|
||||
]);
|
||||
$show->field('user.user_info.nickname', '下单用户');
|
||||
$show->field('user.phone');
|
||||
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_CHANGE])) {
|
||||
$show->field('tracking_number');
|
||||
}
|
||||
|
||||
$show->field('tags')->as(function () {
|
||||
return $this->tags->pluck('name');
|
||||
})->label();
|
||||
if (in_array($show->model()->type, [AfterSaleModel::TYPE_REFUND_AND_RETURN, AfterSaleModel::TYPE_REFUND, AfterSaleModel::TYPE_CHANGE])) {
|
||||
$show->field('sales_value', '销售值');
|
||||
}
|
||||
// $show->field('order_product.cover')->image();
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
|
|
|
|||
|
|
@ -27,9 +27,11 @@ class AppVersionController extends AdminController
|
|||
$grid->column('cate')->using([
|
||||
1=>'苹果',
|
||||
2=>'安卓',
|
||||
3=>'商户端',
|
||||
])->label([
|
||||
1=>'warning',
|
||||
2=>'success',
|
||||
3=>'primary',
|
||||
]);
|
||||
$grid->column('is_force')->bool();
|
||||
$grid->column('apk_link');
|
||||
|
|
@ -55,6 +57,11 @@ class AppVersionController extends AdminController
|
|||
/** 查询 **/
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->equal('cate')->select([
|
||||
1=>'苹果',
|
||||
2=>'安卓',
|
||||
3=>'商户端',
|
||||
])->width(3);
|
||||
$filter->equal('name')->width(3);
|
||||
$filter->equal('title')->width(3);
|
||||
});
|
||||
|
|
@ -99,7 +106,7 @@ class AppVersionController extends AdminController
|
|||
->when(1, function (Form $form) {
|
||||
$form->text('apk_link1')->rules('required_if:cate,1', ['required_if'=>'苹果平台需要填写苹果商店地址']);
|
||||
})
|
||||
->when(2, function (Form $form) {
|
||||
->when([2, 3], function (Form $form) {
|
||||
$form->file('apk_link2')->chunked()
|
||||
->accept('apk', 'apk/*')
|
||||
->move('app-vesrion/apk/'.Carbon::now()->toDateString())
|
||||
|
|
@ -117,6 +124,7 @@ class AppVersionController extends AdminController
|
|||
->options([
|
||||
1=>'苹果',
|
||||
2=>'安卓',
|
||||
3=>'商户端',
|
||||
]);
|
||||
$form->switch('is_force');
|
||||
|
||||
|
|
@ -132,6 +140,9 @@ class AppVersionController extends AdminController
|
|||
$form->hidden('apk_link');
|
||||
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->cate && $form->cate ==3) {
|
||||
$form->cate = 2;
|
||||
}
|
||||
$apk_link = 'apk_link'.$form->cate;
|
||||
$form->apk_link = $form->$apk_link;
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,16 @@ class OrderController extends AdminController
|
|||
return bcdiv($v, 100, 2);
|
||||
})->prepend('- ¥');
|
||||
$show->divider();
|
||||
$show->field('sales_value', '总销售值');
|
||||
$show->field('is_settle', '是否结算')->using([
|
||||
0=>'未结算',
|
||||
1=>'已结算',
|
||||
])->dot([
|
||||
0=>'danger',
|
||||
1=>'success',
|
||||
]);
|
||||
$show->field('completed_at', '完成时间');
|
||||
$show->divider();
|
||||
$show->field('note');
|
||||
$show->field('remark');
|
||||
|
||||
|
|
@ -242,13 +252,24 @@ class OrderController extends AdminController
|
|||
$row->column(7, function ($column) use ($id) {
|
||||
$builder = OrderProduct::withCount('afterSales')->where('order_id', $id);
|
||||
$productGrid = Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('name');
|
||||
$grid->column('cover')->image(50, 50);
|
||||
$grid->column('name')->display(function ($value) {
|
||||
if ($this->gift_for_sku_id) {
|
||||
$value.='-【赠品】';
|
||||
}
|
||||
return $value;
|
||||
});
|
||||
// $grid->column('cover')->image(50, 50);
|
||||
$grid->column('sell_price')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
})->prepend('¥');
|
||||
$grid->column('sales_value', '销售值');
|
||||
$grid->column('quantity');
|
||||
$grid->column('vip_discount_amount', '会员折扣')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
})->prepend('¥');
|
||||
$grid->column('coupon_discount_amount', '优惠券折扣')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
})->prepend('¥');
|
||||
$grid->column('sales_value', '销售值');
|
||||
$grid->column('remain_quantity');
|
||||
|
||||
$grid->column('product_total_amount')->display(function () {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ class AppVersionFilter extends ModelFilter
|
|||
case 'android':
|
||||
$this->onlyAndroid();
|
||||
break;
|
||||
|
||||
case 'merchant':
|
||||
$this->onlyMerchant();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,4 +32,12 @@ class AppVersion extends Model
|
|||
{
|
||||
return $query->where('cate', 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅查询商家端
|
||||
*/
|
||||
public function scopeOnlyMerchant($query)
|
||||
{
|
||||
return $query->where('cate', 3);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue