diff --git a/app/Admin/Controllers/v3/BannersController.php b/app/Admin/Controllers/v3/BannersController.php index eea4f36..1acb0fb 100644 --- a/app/Admin/Controllers/v3/BannersController.php +++ b/app/Admin/Controllers/v3/BannersController.php @@ -92,7 +92,7 @@ class BannersController extends AdminController $form->select('market_id')->options($marketList)->default(0); // 多个市场 $form->multipleSelect('market_ids')->options($marketList); - $form->select('type')->options(BannersModel::$_type)->required(); + $form->select('type')->options(BannersModel::$_TYPE)->required(); $form->text('title')->required(); $form->text('sub_title'); $form->number('sort')->default(0); @@ -106,9 +106,9 @@ class BannersController extends AdminController }); $form->column(6, function (Form $form) { $form->image('cover')->required()->uniqueName(); - $form->select('cover_type')->options(BannersModel::$_coverType)->required(); + $form->select('cover_type')->options(BannersModel::$_COVER_TYPE)->required(); $form->text('path')->default(''); - $form->select('path_type')->options(BannersModel::$_pathType)->default(''); + $form->select('path_type')->options(BannersModel::$_PATH_TYPE)->default(''); }); $form->disableResetButton(); diff --git a/app/Admin/Controllers/v3/GoodsActivityController.php b/app/Admin/Controllers/v3/GoodsActivityController.php index b2d0296..57b9730 100644 --- a/app/Admin/Controllers/v3/GoodsActivityController.php +++ b/app/Admin/Controllers/v3/GoodsActivityController.php @@ -143,7 +143,7 @@ class GoodsActivityController extends AdminController $form->select('store_id')->required()->options($storeList); $form->text('name')->required()->maxLength(20); $form->image('cover_img')->required()->uniqueName(); - $form->select('type')->options(GoodsActivityModel::$_type)->default('flash_sale'); + $form->select('type')->options(GoodsActivityModel::$_TYPE)->default('flash_sale'); $form->datetime('expire_time')->required()->format('YYYY-MM-DD HH:mm:ss')->help($form->model()->expire_time_text); }); $form->column(6, function (Form $form) { diff --git a/app/Admin/Controllers/v3/GoodsNewController.php b/app/Admin/Controllers/v3/GoodsNewController.php index 40af02a..191e2f6 100644 --- a/app/Admin/Controllers/v3/GoodsNewController.php +++ b/app/Admin/Controllers/v3/GoodsNewController.php @@ -71,6 +71,7 @@ class GoodsNewController extends AdminController $filter->equal('category_id')->select($categoryList); $filter->equal('goods_category_id')->select($goodsCategoryList); $filter->equal('market_id')->select($marketList); + $filter->equal('on_sale')->select(GoodsModel::$_ONSALE); }); $grid->model()->orderBy('category_id', 'asc'); diff --git a/app/Admin/Controllers/v3/ServicePersonnelController.php b/app/Admin/Controllers/v3/ServicePersonnelController.php index 5ed0c54..7b0683e 100644 --- a/app/Admin/Controllers/v3/ServicePersonnelController.php +++ b/app/Admin/Controllers/v3/ServicePersonnelController.php @@ -45,8 +45,9 @@ class ServicePersonnelController extends AdminController $filter->equal('type')->select(ServicePersonnelModel::$_TYPE); $filter->equal('market_id')->select($marketList); }); - // 每页10条 - $grid->paginate(10); + // 每页10条 + $grid->paginate(10); + $grid->disableDeleteButton(); }); } @@ -60,17 +61,33 @@ class ServicePersonnelController extends AdminController protected function detail($id) { return Show::make($id, new ServicePersonnel(), function (Show $show) { - $show->field('id'); - $show->field('user_id'); - $show->field('name'); - $show->field('tel'); - $show->field('market_id'); - $show->field('type'); - $show->field('status'); - $show->field('qr_url'); - $show->field('head_url'); - $show->field('created_at'); - $show->field('updated_at'); + $show->row(function (Show\Row $show) { + $show->width(6)->id; + $show->width(6)->field('name'); + $show->width(6)->field('tel'); + $show->width(6)->field('user_id')->as(function($userId){ + $item = UserModel::getUserInfo($userId,'nick_name'); + return empty($item) ? '' : '【'.$userId.'】:' . $item['nick_name']; + }); + + $show->width(6)->field('head_url')->image(); + $show->width(6)->field('qr_url')->image(); + }); + $show->row(function (Show\Row $show) { + $show->width(6)->field('market_id')->as(function($marketId){ + $item = MarketModel::getMarketInfo($marketId,'name'); + return empty($item) ? '' : $item['name']; + }); + $show->width(6)->field('type_text'); + $show->width(6)->field('status_text'); + + $show->width(6)->field('created_at')->as(function($createdAt){ + return date('Y-m-d H:i:s',$createdAt); + }); + $show->width(6)->field('updated_at')->as(function($updatedAt){ + return date('Y-m-d H:i:s',$updatedAt); + }); + }); }); } diff --git a/app/Admin/Repositories/StoreUserReport.php b/app/Admin/Repositories/StoreUserReport.php index dc78530..9131dae 100644 --- a/app/Admin/Repositories/StoreUserReport.php +++ b/app/Admin/Repositories/StoreUserReport.php @@ -2,7 +2,7 @@ namespace App\Admin\Repositories; -use App\Models\Store as Model; +use App\Models\v3\Store as Model; use Dcat\Admin\Grid\Model as GridModel; use Dcat\Admin\Repositories\EloquentRepository; use App\Models\StoreAccount as StoreAccountModel; diff --git a/app/Models/v3/Banners.php b/app/Models/v3/Banners.php index bf2296d..2bd698c 100644 --- a/app/Models/v3/Banners.php +++ b/app/Models/v3/Banners.php @@ -25,10 +25,10 @@ class Banners extends Model 'market_ids'=>'array', ]; - public static $_coverType = [1=>'图片', 2=>'视频']; - public static $_pathType = ['page'=>'page','webview'=>'webview','applet'=>'applet']; - public static $_type = [1=>'首页']; - public static $_status = ['禁用', '正常']; + public static $_COVER_TYPE = [1=>'图片', 2=>'视频']; + public static $_PATH_TYPE = ['page'=>'page','webview'=>'webview','applet'=>'applet']; + public static $_TYPE = [1=>'首页']; + public static $_STATUS = ['禁用', '正常']; public function getCoverUrlAttribute($value) { @@ -39,22 +39,22 @@ class Banners extends Model public function getCoverTypeTextAttribute($value) { $value = $value ? $value : $this->cover_type; - return isset(self::$_coverType[$value]) ? self::$_coverType[$value] : ''; + return isset(self::$_COVER_TYPE[$value]) ? self::$_COVER_TYPE[$value] : ''; } public function getPathTypeTextAttribute($value) { $value = $value ? $value : $this->path_type; - return isset(self::$_pathType[$value]) ? self::$_pathType[$value] : ''; + return isset(self::$_PATH_TYPE[$value]) ? self::$_PATH_TYPE[$value] : ''; } public function getTypeTextAttribute($value) { $value = $value ? $value : $this->type; - return isset(self::$_type[$value]) ? self::$_type[$value] : ''; + return isset(self::$_TYPE[$value]) ? self::$_TYPE[$value] : ''; } public function getStatusTextAttribute($value) { $value = $value ? $value : $this->stauts; - return isset(self::$_status[$value]) ? self::$_status[$value] : ''; + return isset(self::$_STATUS[$value]) ? self::$_STATUS[$value] : ''; } /** * 处理旧图片 diff --git a/app/Models/v3/Goods.php b/app/Models/v3/Goods.php index 0105f41..f9c98be 100644 --- a/app/Models/v3/Goods.php +++ b/app/Models/v3/Goods.php @@ -27,8 +27,8 @@ class Goods extends Model 'spec'=>'array', ]; - public static $_onSale = ['否','是']; - public static $_isInfinite = ['关闭','开启']; + public static $_ONSALE = ['否','是']; + public static $_ISINFINITE = ['关闭','开启']; public function getCoverImgUrlAttribute($value) { @@ -38,12 +38,12 @@ class Goods extends Model public function getOnSaleTextAttribute($value) { $value = $value ? $value : $this->on_sale; - return isset(self::$_onSale[$value]) ? self::$_onSale[$value] : ''; + return isset(self::$_ONSALE[$value]) ? self::$_ONSALE[$value] : ''; } public function getIsInfiniteTextAttribute($value) { $value = $value ? $value : $this->is_infinite; - return isset(self::$_isInfinite[$value]) ? self::$_isInfinite[$value] : ''; + return isset(self::$_ISINFINITE[$value]) ? self::$_ISINFINITE[$value] : ''; } public function ImageBanners(){ return $this->hasMany('\App\Models\v3\GoodsBanners','goods_id','id')->where('type',1); diff --git a/app/Models/v3/GoodsActivity.php b/app/Models/v3/GoodsActivity.php index 7cbdd9e..009ae4e 100644 --- a/app/Models/v3/GoodsActivity.php +++ b/app/Models/v3/GoodsActivity.php @@ -28,10 +28,10 @@ class GoodsActivity extends Model 'spec'=>'array', ]; - public static $_type = ['flash_sale'=>'秒杀','group_buy'=>'团购','new_product'=>'新品']; - public static $_onSale = ['否','是']; - public static $_isInfinite = ['关闭','开启']; - public static $_canUseCoupon = ['否','是']; + public static $_TYPE = ['flash_sale'=>'秒杀','group_buy'=>'团购','new_product'=>'新品']; + public static $_ONSALE = ['否','是']; + public static $_ISINFINITE = ['关闭','开启']; + public static $_CAN_USE_COUPON = ['否','是']; public function getCoverImgUrlAttribute($value) { @@ -41,22 +41,22 @@ class GoodsActivity extends Model public function getTypeTextAttribute($value) { $value = $value ? $value : $this->type; - return isset(self::$_isInfinite[$value]) ? self::$_isInfinite[$value] : ''; + return isset(self::$_TYPE[$value]) ? self::$_TYPE[$value] : ''; } public function getOnSaleTextAttribute($value) { $value = $value ? $value : $this->on_sale; - return isset(self::$_onSale[$value]) ? self::$_onSale[$value] : ''; + return isset(self::$_ONSALE[$value]) ? self::$_ONSALE[$value] : ''; } public function getIsInfiniteTextAttribute($value) { $value = $value ? $value : $this->is_infinite; - return isset(self::$_isInfinite[$value]) ? self::$_isInfinite[$value] : ''; + return isset(self::$_ISINFINITE[$value]) ? self::$_ISINFINITE[$value] : ''; } public function getCanUseCouponTextAttribute($value) { $value = $value ? $value : $this->can_use_coupon; - return isset(self::$_isInfinite[$value]) ? self::$_isInfinite[$value] : ''; + return isset(self::$_CAN_USE_COUPON[$value]) ? self::$_CAN_USE_COUPON[$value] : ''; } public function getExpireTimeTextAttribute() { diff --git a/app/Models/v3/GoodsNew.php b/app/Models/v3/GoodsNew.php index 69c921d..0850ba2 100644 --- a/app/Models/v3/GoodsNew.php +++ b/app/Models/v3/GoodsNew.php @@ -27,8 +27,8 @@ class GoodsNew extends Model 'spec'=>'array', ]; - public static $_onSale = ['否','是']; - public static $_isInfinite = ['关闭','开启']; + public static $_ONSALE = ['否','是']; + public static $_ISINFINITE = ['关闭','开启']; public function getCoverImgUrlAttribute($value) { @@ -38,12 +38,12 @@ class GoodsNew extends Model public function getOnSaleTextAttribute($value) { $value = $value ? $value : $this->on_sale; - return isset(self::$_onSale[$value]) ? self::$_onSale[$value] : ''; + return isset(self::$_ONSALE[$value]) ? self::$_ONSALE[$value] : ''; } public function getIsInfiniteTextAttribute($value) { $value = $value ? $value : $this->is_infinite; - return isset(self::$_isInfinite[$value]) ? self::$_isInfinite[$value] : ''; + return isset(self::$_ISINFINITE[$value]) ? self::$_ISINFINITE[$value] : ''; } public function ImageNewBanners(){ return $this->hasMany('\App\Models\v3\GoodsNewBanners','goods_id','id')->where('type',1);