diff --git a/app/Admin/Controllers/AfterSaleController.php b/app/Admin/Controllers/AfterSaleController.php index 39318476..d5cd0499 100644 --- a/app/Admin/Controllers/AfterSaleController.php +++ b/app/Admin/Controllers/AfterSaleController.php @@ -74,15 +74,7 @@ class AfterSaleController extends AdminController AfterSaleModel::TYPE_CHANGE => '换货', AfterSaleModel::TYPE_FILL => '漏发', ])->label(); - $grid->column('state')->using([ - AfterSaleModel::STATE_APPLY=>'待补充资料', - AfterSaleModel::STATE_VERIFY=>'待审核', - AfterSaleModel::STATE_AGREE=>'待确认', - AfterSaleModel::STATE_SHIPPING=>'待收货', - AfterSaleModel::STATE_FINANCE=>'待打款', - AfterSaleModel::STATE_FINISH=>'已完成', - AfterSaleModel::STATE_CANCEL=>'已取消', - ])->dot([ + $grid->column('state')->using(AfterSaleModel::$stateText)->dot([ AfterSaleModel::STATE_APPLY=>'warning', AfterSaleModel::STATE_VERIFY=>'danger', AfterSaleModel::STATE_AGREE=>'warning', @@ -106,15 +98,7 @@ class AfterSaleController extends AdminController $grid->filter(function (Grid\Filter $filter) { $filter->panel(); - $filter->equal('state')->select([ - AfterSaleModel::STATE_APPLY=>'待补充资料', - AfterSaleModel::STATE_VERIFY=>'待审核', - AfterSaleModel::STATE_AGREE=>'待确认', - AfterSaleModel::STATE_SHIPPING=>'待收货', - AfterSaleModel::STATE_FINANCE=>'待打款', - AfterSaleModel::STATE_FINISH=>'已完成', - AfterSaleModel::STATE_CANCEL=>'已取消', - ])->width(3); + $filter->equal('state')->select(AfterSaleModel::$stateText)->width(3); $filter->equal('user.phone')->width(3); $filter->equal('order.sn')->width(3); $filter->equal('sn')->width(3); @@ -164,15 +148,7 @@ class AfterSaleController extends AdminController AfterSaleModel::TYPE_CHANGE => '换货', AfterSaleModel::TYPE_FILL => '漏发', ])->label(); - $show->field('state')->using([ - AfterSaleModel::STATE_APPLY=>'待补充资料', - AfterSaleModel::STATE_VERIFY=>'待审核', - AfterSaleModel::STATE_AGREE=>'待确认', - AfterSaleModel::STATE_SHIPPING=>'待收货', - AfterSaleModel::STATE_FINANCE=>'待打款', - AfterSaleModel::STATE_FINISH=>'已完成', - AfterSaleModel::STATE_CANCEL=>'已取消', - ])->dot([ + $show->field('state')->using(AfterSaleModel::$stateText)->dot([ AfterSaleModel::STATE_APPLY=>'warning', AfterSaleModel::STATE_VERIFY=>'danger', AfterSaleModel::STATE_AGREE=>'warning', diff --git a/app/Admin/Controllers/HomeController.php b/app/Admin/Controllers/HomeController.php index 6c387cd2..985c04ed 100644 --- a/app/Admin/Controllers/HomeController.php +++ b/app/Admin/Controllers/HomeController.php @@ -23,12 +23,12 @@ class HomeController extends Controller $row->column(6, function (Column $column) { $column->row(Dashboard::title()); $column->row(new StatisticsTotal()); + $column->row(new Users()); }); $row->column(6, function (Column $column) { $column->row(new NewUsers()); $column->row(new Orders()); - $column->row(new Users()); }); }); } diff --git a/app/Admin/Controllers/ProductSkuVerifyController.php b/app/Admin/Controllers/ProductSkuVerifyController.php index f0aded79..5506319e 100644 --- a/app/Admin/Controllers/ProductSkuVerifyController.php +++ b/app/Admin/Controllers/ProductSkuVerifyController.php @@ -69,6 +69,12 @@ class ProductSkuVerifyController extends AdminController $grid->filter(function (Grid\Filter $filter) { $filter->panel(); $filter->equal('sku_id')->select(admin_route('api.product_skus'))->width('3'); + $filter->equal('status')->select([ + 0=>'未处理', + 1=>'成功', + 2=>'拒绝', + 3=>'已取消', + ])->width('3'); }); }); } diff --git a/app/Admin/Metrics/Dashboard.php b/app/Admin/Metrics/Dashboard.php index 53e32e71..120b8d7c 100644 --- a/app/Admin/Metrics/Dashboard.php +++ b/app/Admin/Metrics/Dashboard.php @@ -2,10 +2,22 @@ namespace App\Admin\Metrics; +use App\Models\AfterSale; +use App\Models\Order; +use App\Models\ProductSkuVerify; + class Dashboard { public static function title() { - return view('admin.metrics.dashboard'); + $num = [ + 'after_sales_wait_verify'=> AfterSale::where('state', AfterSale::STATE_VERIFY)->count(), + 'after_sales_wait_shipping'=> AfterSale::where('state', AfterSale::STATE_SHIPPING)->count(), + 'after_sales_wait_finance'=> AfterSale::where('state', AfterSale::STATE_FINANCE)->count(), + 'orders_wait_shipping'=> Order::where('status', Order::STATUS_PAID)->where('shipping_state', '<', Order::SHIPPING_STATE_PROCESSED)->count(), + 'skus_wait_verify'=> ProductSkuVerify::where('status', 0)->count(), + + ]; + return view('admin.metrics.dashboard', compact('num')); } } diff --git a/app/Admin/Metrics/StatisticsTotal.php b/app/Admin/Metrics/StatisticsTotal.php index 68226b92..5a98c383 100644 --- a/app/Admin/Metrics/StatisticsTotal.php +++ b/app/Admin/Metrics/StatisticsTotal.php @@ -15,7 +15,7 @@ class StatisticsTotal extends RadialBar parent::init(); $this->title('统计预览'); - $this->height(400); + $this->height(320); $this->contentWidth(12, 0); // $this->chartLabels('Completed Tickets'); diff --git a/app/Models/AfterSale.php b/app/Models/AfterSale.php index a6da4b25..e52c8334 100644 --- a/app/Models/AfterSale.php +++ b/app/Models/AfterSale.php @@ -44,6 +44,16 @@ class AfterSale extends Model 'tracking_number', ]; + public static $stateText = [ + self::STATE_APPLY=>'待补充资料', + self::STATE_VERIFY=>'待处理', + self::STATE_AGREE=>'待确认', + self::STATE_SHIPPING=>'待收货', + self::STATE_FINANCE=>'待审核', + self::STATE_FINISH=>'已完成', + self::STATE_CANCEL=>'已取消', + ]; + /** * 获取售后订单状态进度 * diff --git a/resources/views/admin/metrics/dashboard.blade.php b/resources/views/admin/metrics/dashboard.blade.php index 1563606d..88df1fee 100644 --- a/resources/views/admin/metrics/dashboard.blade.php +++ b/resources/views/admin/metrics/dashboard.blade.php @@ -32,41 +32,27 @@