Browse Source

feat: 后台

xiansin 2 years ago
parent
commit
25f9ba3f77
32 changed files with 987 additions and 301 deletions
  1. 34 0
      server/app/Admin/Actions/Form/ResetPasswordForm.php
  2. 41 0
      server/app/Admin/Actions/Grid/ResetPassword.php
  3. 125 0
      server/app/Admin/Controllers/AccountController.php
  4. 27 35
      server/app/Admin/Controllers/ProductCategoryController.php
  5. 120 32
      server/app/Admin/Controllers/ProductController.php
  6. 53 19
      server/app/Admin/Controllers/ProductHotController.php
  7. 0 77
      server/app/Admin/Controllers/ProductSkuController.php
  8. 102 0
      server/app/Admin/Controllers/ProductSpecController.php
  9. 71 0
      server/app/Admin/Controllers/ProductSpecGroupController.php
  10. 64 19
      server/app/Admin/Controllers/ShowroomCaseController.php
  11. 19 13
      server/app/Admin/Controllers/ShowroomController.php
  12. 0 16
      server/app/Admin/Repositories/ProductHot.php
  13. 5 1
      server/app/Admin/routes.php
  14. 22 0
      server/app/Casts/DelimiterCast.php
  15. 14 0
      server/app/Models/Account.php
  16. 17 0
      server/app/Models/Product.php
  17. 7 1
      server/app/Models/ProductCategory.php
  18. 10 1
      server/app/Models/ProductHot.php
  19. 27 20
      server/app/Models/ProductSpec.php
  20. 56 0
      server/app/Models/ProductSpecGroup.php
  21. 12 1
      server/app/Models/ShowroomCase.php
  22. 5 35
      server/config/global.php
  23. 48 28
      server/dcat_admin_ide_helper.php
  24. 18 0
      server/resources/lang/zh/account.php
  25. 3 1
      server/resources/lang/zh/product-category.php
  26. 1 0
      server/resources/lang/zh/product-hot.php
  27. 17 0
      server/resources/lang/zh/product-spec-group.php
  28. 20 0
      server/resources/lang/zh/product-spec.php
  29. 3 2
      server/resources/lang/zh/product.php
  30. 17 0
      server/resources/lang/zh_CN/account.php
  31. 13 0
      server/resources/lang/zh_CN/product-spec-group.php
  32. 16 0
      server/resources/lang/zh_CN/product-spec.php

+ 34 - 0
server/app/Admin/Actions/Form/ResetPasswordForm.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+namespace App\Admin\Actions\Form;
+
+use App\Models\Account;
+use Dcat\Admin\Contracts\LazyRenderable;
+use Dcat\Admin\Traits\LazyWidget;
+use Dcat\Admin\Widgets\Form;
+
+class ResetPasswordForm extends Form implements LazyRenderable
+{
+    use LazyWidget;
+
+    //弹窗表单
+    public function form()
+    {
+        $id = isset($this->payload['id']) ? $this->payload['id'] : 0;
+        $this->hidden('id')->value($id);
+        $this->password('password', '密码')->required();
+    }
+
+    //点击表单处理
+    public function handle(array $input)
+    {
+        try {
+            $account = Account::find($input['id']);
+            $account->password =  \Hash::make($input['password']);;
+            $account->save();
+        } catch (\Exception $exception) {
+            return $this->response()->error($exception->getMessage());
+        }
+        return $this->response()->success('success')->refresh();
+    }
+}

+ 41 - 0
server/app/Admin/Actions/Grid/ResetPassword.php

xqd
@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Admin\Actions\Grid;
+
+use App\Admin\Actions\Form\ResetPasswordForm;
+use App\Models\Account;
+use Dcat\Admin\Actions\Response;
+use Dcat\Admin\Form\AbstractTool;
+use Dcat\Admin\Grid\RowAction;
+use Dcat\Admin\Traits\HasPermissions;
+use Dcat\Admin\Widgets\Modal;
+use Illuminate\Contracts\Auth\Authenticatable;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Http\Request;
+
+class ResetPassword extends AbstractTool
+{
+    /**
+     * @return string
+     */
+    protected $title = '重置密码';
+
+    protected $model;
+
+    public function __construct(string $model = null, $id = 0)
+    {
+        $this->model = $model;
+        $this->title = '<i class="feather icon-lock"></i> ' . $this->title;
+        $this->id = $id;
+    }
+
+    public function render()
+    {
+        $form = ResetPasswordForm::make()->payload(['id' => $this->id]);
+        return Modal::make()
+            ->lg()
+            ->title($this->title)
+            ->body($form)
+            ->button($this->title);
+    }
+}

+ 125 - 0
server/app/Admin/Controllers/AccountController.php

xqd
@@ -0,0 +1,125 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Actions\Grid\ResetPassword;
+use App\Models\Account;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class AccountController extends AdminController
+{
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new Account(), function (Grid $grid) {
+            $grid->column('id')->sortable();
+            $grid->column('user_name');
+            $grid->column('type')
+                ->using(config('global.user_type'))
+                ->label(['info','primary','success']);;
+            $grid->column('account');
+            $grid->column('status')
+                ->using(config('global.user_status'))
+                ->label(['danger','success'])->switch();
+            $grid->column('remark')->editable();
+            $grid->column('created_at');
+            $grid->actions(function (Grid\Displayers\Actions $actions) {
+                $actions->append(new ResetPassword(Account::class, $actions->row->id));
+            });
+
+            $grid->disableViewButton();
+
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new Account(), function (Show $show) {
+            $show->field('id');
+            $show->field('user_name');
+            $show->field('account');
+            $show->field('password');
+            $show->field('type');
+            $show->field('remark');
+            $show->field('status');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new Account(), function (Form $form) {
+            $form->display('id');
+            $form->text('user_name')->required();
+            $form->mobile('account')
+                ->placeholder('手机号')
+                ->required()
+                ->rules(function ($form) {
+                    // 如果不是编辑状态,则添加字段唯一验证
+                    if (!$form->model()->id) {
+                        return 'unique:accounts';
+                    }
+                });
+            $form->password('password')
+                ->placeholder('默认123456');
+            $form->radio('type')
+                ->options(config('global.user_type'))
+                ->default(1);
+            $form->radio('status')
+                ->options(config('global.user_status'))
+                ->default(1);
+            $form->textarea('remark');
+
+            $form->display('created_at');
+            //$form->display('updated_at');
+
+            $form->saving(function (Form $form) {
+                // 如果不是编辑状态 不填写密码默认123456
+                if (!$form->model()->id) {
+                     if(!$form->password){
+                         $form->password = \Hash::make(123456);
+                     }else{
+                         $form->password = \Hash::make($form->password);
+                     }
+                }else{
+                    if ($form->password && $form->model()->password != $form->password) {
+                        $form->password = \Hash::make($form->password);
+                    }
+
+                    if (! $form->password) {
+                        $form->deleteInput('password');
+                    }
+                }
+
+            });
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
+
+        });
+    }
+}

+ 27 - 35
server/app/Admin/Controllers/ProductCategoryController.php

xqd xqd
@@ -18,40 +18,17 @@ class ProductCategoryController extends AdminController
     protected function grid()
     {
         return Grid::make(new ProductCategory(), function (Grid $grid) {
+            $grid->model()->orderByDesc('sort');
             $grid->column('id')->sortable();
             $grid->column('name');
-            $grid->column('level');
-            $grid->column('pid');
-            $grid->column('sort');
+            $grid->column('level')->using(config('global.cat_level'));
+            $grid->column('is_opened')->switch();
+            $grid->column('sort')->editable();
             $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
-            $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
-            });
+            $grid->disableViewButton();
         });
     }
 
-    /**
-     * Make a show builder.
-     *
-     * @param mixed $id
-     *
-     * @return Show
-     */
-    protected function detail($id)
-    {
-        return Show::make($id, new ProductCategory(), function (Show $show) {
-            $show->field('id');
-            $show->field('name');
-            $show->field('level');
-            $show->field('pid');
-            $show->field('sort');
-            $show->field('created_at');
-            $show->field('updated_at');
-        });
-    }
 
     /**
      * Make a form builder.
@@ -62,13 +39,28 @@ class ProductCategoryController extends AdminController
     {
         return Form::make(new ProductCategory(), function (Form $form) {
             $form->display('id');
-            $form->text('name');
-            $form->text('level');
-            $form->text('pid');
-            $form->text('sort');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+            $form->radio('level')
+                ->when(2, function (Form $form){
+                    $options = ProductCategory::select(['id','name'])
+                        ->where('level',1)
+                        ->get()
+                        ->pluck('name', 'id');
+                    $form->select('pid')->options($options);
+                })
+                ->options(config('global.cat_level'))
+                ->default(1);
+            $form->text('name')->required();
+            $form->radio('is_opened')
+                ->options(config('global.bool_status'))
+                ->default(1);
+            $form->number('sort');
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
         });
     }
 }

+ 120 - 32
server/app/Admin/Controllers/ProductController.php

xqd xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Admin\Controllers;
 
 use App\Models\Product;
+use App\Models\ProductCategory;
 use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
@@ -17,27 +18,79 @@ class ProductController extends AdminController
      */
     protected function grid()
     {
-        return Grid::make(new Product(), function (Grid $grid) {
+        return Grid::make(Product::with('cate'), function (Grid $grid) {
+            $grid->model()->orderByDesc('sort');
             $grid->column('id')->sortable();
-            $grid->column('name');
-            $grid->column('cover_img');
-            $grid->column('cases');
-            $grid->column('origin_price');
-            $grid->column('sale_price');
-            $grid->column('sort');
-            $grid->column('is_opened');
-            $grid->column('tech_param');
-            $grid->column('cad_model');
-            $grid->column('cad_design');
-            $grid->column('su_model');
-            $grid->column('other');
+            $grid->column('name')->label('info');
+            $grid->column('cate_id')->display(function (){
+                return $this->cate->name;
+            })->label('success');
+            $grid->column('cover_img')->image('',80);
+            $grid->column('cases')->display(function (){
+                $html = '';
+                foreach ($this->cases as $case){
+                    $html .= '<img data-action="preview-img" src="'.$case.'"
+style="max-width:80px;max-height:80px;cursor:pointer"
+class="img img-thumbnail">';
+                }
+                return $html;
+            });
+            $grid->column('tech_param')->display(function (){
+                $html = '';
+                foreach ($this->tech_param as $key => $tech_param){
+                    $index = $key+1;
+                    $html .= "<a href='{$tech_param}' download target='_blank'>参数文件{$index}</a><br>";
+                }
+                return $html;
+            });
+            $grid->column('cad_model')->display(function (){
+                $html = '';
+                foreach ($this->cad_model as $key => $tech_param){
+                    $index = $key+1;
+                    $html .= "<a href='{$tech_param}' download target='_blank'>CAD模型{$index}</a><br>";
+                }
+                return $html;
+            });
+            $grid->column('cad_design')->display(function (){
+                $html = '';
+                foreach ($this->cad_design as $key => $tech_param){
+                    $index = $key+1;
+                    $html .= "<a href='{$tech_param}' download target='_blank'>CAD设计$index</a><br>";
+                }
+                return $html;
+            });
+            $grid->column('su_model')->display(function (){
+                $html = '';
+                foreach ($this->su_model as $key => $tech_param){
+                    $index = $key+1;
+                    $html .= "<a href='{$tech_param}' download target='_blank'>SU模型{$index}</a><br>";
+                }
+                return $html;
+            });
+            $grid->column('other')->display(function (){
+                $html = '';
+                foreach ($this->other as $key => $tech_param){
+                    $index = $key+1;
+                    $html .= "<a href='{$tech_param}' download target='_blank'>其他文件{$index}</a><br>";
+                }
+                return $html;
+            });
+            $grid->column('is_opened')->switch();
+            $grid->column('sort')->editable();
             $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
+
+            $grid->actions(function (Grid\Displayers\Actions $actions) {
+                $id = $actions->getKey();
+                // append一个操作
+                $actions->append('<a href="/admin/product/'.$id.'/spec"><i class="fa fa-align-left"></i> 规格管理</a>');
+            });
+
             $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
+                $filter->panel();
+                $filter->like('name')->width(2);
             });
+
+            $grid->disableViewButton();
         });
     }
 
@@ -78,21 +131,56 @@ class ProductController extends AdminController
     {
         return Form::make(new Product(), function (Form $form) {
             $form->display('id');
-            $form->text('name');
-            $form->text('cover_img');
-            $form->text('cases');
-            $form->text('origin_price');
-            $form->text('sale_price');
-            $form->text('sort');
-            $form->text('is_opened');
-            $form->text('tech_param');
-            $form->text('cad_model');
-            $form->text('cad_design');
-            $form->text('su_model');
-            $form->text('other');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+            $cates = ProductCategory::select(['id','name'])->where('is_opened',1)->get()->toArray();
+            $form->select('cate_id')
+                ->options(array_column($cates,'name','id'))
+                ->required();;
+            $form->text('name')->required();;;
+            $form->image('cover_img')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4)
+                ->required();
+            $form->multipleImage('cases')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleFile('tech_param')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleFile('cad_model')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleFile('cad_design')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleFile('su_model')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleFile('other')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->radio('is_opened')->options(config('global.bool_status'))->default(1);
+            $form->number('sort');
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
         });
     }
 }

+ 53 - 19
server/app/Admin/Controllers/ProductHotController.php

xqd xqd xqd xqd
@@ -2,7 +2,9 @@
 
 namespace App\Admin\Controllers;
 
-use App\Admin\Repositories\ProductHot;
+use App\Models\Product;
+use App\Models\ProductCategory;
+use App\Models\ProductHot;
 use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
@@ -10,6 +12,20 @@ use Dcat\Admin\Http\Controllers\AdminController;
 
 class ProductHotController extends AdminController
 {
+    const TYPE_normal = 'normal'; // 普通用户
+    const TYPE_VIP = 'vip'; // VIP/设计师
+
+    protected $types = ['normal' => 1, 'vip' => 2];
+
+    protected $type = 1;
+
+    public function __construct()
+    {
+        $route = \request()->route();
+        $arr = explode("/",$route->uri);
+        $this->type = $this->types[$arr[2]]??1;
+    }
+
     /**
      * Make a grid builder.
      *
@@ -17,19 +33,23 @@ class ProductHotController extends AdminController
      */
     protected function grid()
     {
-        return Grid::make(new ProductHot(), function (Grid $grid) {
+        return Grid::make(ProductHot::with(['product']), function (Grid $grid) {
+            $grid->model()->orderByDesc('sort');
+            $grid->model()->where('type', $this->type);
             $grid->column('id')->sortable();
-            $grid->column('type');
-            $grid->column('product_id');
-            $grid->column('sort');
-            $grid->column('is_opened');
-            $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
-            $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
+            $grid->column('cover_img')->image('',80);
+            $grid->column('product_id')->display(function (){
+                return $this->product->name;
             });
+            $grid->column('is_opened')->switch();
+            $grid->column('sort')->editable();
+            $grid->column('created_at');
+
+//            $grid->filter(function (Grid\Filter $filter) {
+//                $filter->equal('id');
+//
+//            });
+            $grid->disableViewButton();
         });
     }
 
@@ -62,13 +82,27 @@ class ProductHotController extends AdminController
     {
         return Form::make(new ProductHot(), function (Form $form) {
             $form->display('id');
-            $form->text('type');
-            $form->text('product_id');
-            $form->text('sort');
-            $form->text('is_opened');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+            $form->hidden('type')->value($this->type);
+            $cates = Product::select(['id','name'])->where('is_opened',1)->get()->toArray();
+            $form->select('product_id')
+                ->options(array_column($cates,'name','id'))
+                ->required();
+            $form->image('cover_img')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4)
+                ->required();
+            $form->radio('is_opened')->options(config('global.bool_status'))->default(1);
+            $form->number('sort');
+
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
         });
     }
 }

+ 0 - 77
server/app/Admin/Controllers/ProductSkuController.php

xqd
@@ -1,77 +0,0 @@
-<?php
-
-namespace App\Admin\Controllers;
-
-use App\Models\ProductSku;
-use Dcat\Admin\Form;
-use Dcat\Admin\Grid;
-use Dcat\Admin\Show;
-use Dcat\Admin\Http\Controllers\AdminController;
-
-class ProductSkuController extends AdminController
-{
-    /**
-     * Make a grid builder.
-     *
-     * @return Grid
-     */
-    protected function grid()
-    {
-        return Grid::make(new ProductSku(), function (Grid $grid) {
-            $grid->column('id')->sortable();
-            $grid->column('product_id');
-            $grid->column('name');
-            $grid->column('cover_img');
-            $grid->column('origin_price');
-            $grid->column('sale_price');
-            $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
-            $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
-            });
-        });
-    }
-
-    /**
-     * Make a show builder.
-     *
-     * @param mixed $id
-     *
-     * @return Show
-     */
-    protected function detail($id)
-    {
-        return Show::make($id, new ProductSku(), function (Show $show) {
-            $show->field('id');
-            $show->field('product_id');
-            $show->field('name');
-            $show->field('cover_img');
-            $show->field('origin_price');
-            $show->field('sale_price');
-            $show->field('created_at');
-            $show->field('updated_at');
-        });
-    }
-
-    /**
-     * Make a form builder.
-     *
-     * @return Form
-     */
-    protected function form()
-    {
-        return Form::make(new ProductSku(), function (Form $form) {
-            $form->display('id');
-            $form->text('product_id');
-            $form->text('name');
-            $form->text('cover_img');
-            $form->text('origin_price');
-            $form->text('sale_price');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
-        });
-    }
-}

+ 102 - 0
server/app/Admin/Controllers/ProductSpecController.php

xqd
@@ -0,0 +1,102 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\ProductSpec;
+use App\Models\ProductSpecGroup;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Layout\Content;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class ProductSpecController extends AdminController
+{
+
+    protected $product_id;
+
+    public function __construct()
+    {
+        $route = \request()->route();
+        $this->product_id = $route->parameters['id'];
+
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(ProductSpec::with('group.product'), function (Grid $grid) {
+            $grid->model()->orderByDesc('group_id')->orderByDesc('sort');
+            $grid->column('id')->sortable();
+            $grid->column('product','产品')->display(function (){
+                return $this->group->product->name;
+            })->label('info');
+            $grid->column('group_id')->display(function (){
+                return $this->group->name;
+            })->label('success');
+            $grid->column('name')->label('primary');
+            $grid->column('sale_price')->editable();
+            $grid->column('is_opened')->switch();
+            $grid->column('sort')->editable();
+            $grid->column('created_at');
+
+            $url = admin_url('/product/'.$this->product_id.'/specGroup');
+            $grid->tools('<a href="'.$url.'" class="btn btn-primary btn-outline" style="position: absolute;right: 118px;">
+<i class="fa fa-align-justify"></i> 规格组管理</a>');
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new ProductSpec(), function (Show $show) {
+            $show->field('id');
+            $show->field('group_id');
+            $show->field('name');
+            $show->field('cover_img');
+            $show->field('origin_price');
+            $show->field('sale_price');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new ProductSpec(), function (Form $form) {
+            $form->display('id');
+            $cates = ProductSpecGroup::select(['id','name'])->where('is_opened',1)->get()->toArray();
+            $form->radio('group_id')
+                ->options(array_column($cates,'name','id'))
+                ->required();
+
+            $form->text('name')->required();
+            $form->decimal('sale_price')->required();
+            $form->radio('is_opened')->options(config('global.bool_status'))->default(1);
+            $form->number('sort');
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
+
+        });
+    }
+}

+ 71 - 0
server/app/Admin/Controllers/ProductSpecGroupController.php

xqd
@@ -0,0 +1,71 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\ProductSpecGroup;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class ProductSpecGroupController extends AdminController
+{
+    protected $product_id;
+
+    public function __construct()
+    {
+        $route = \request()->route();
+        $this->product_id = $route->parameters['id'];
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(ProductSpecGroup::with('product'), function (Grid $grid) {
+            $grid->model()->orderByDesc('sort');
+            $grid->column('id')->sortable();
+            $grid->column('product_id')->display(function (){
+                return $this->product->name;
+            })->label('info');
+            $grid->column('name')->label('success');
+            $grid->column('is_opened')->switch();
+            $grid->column('sort')->editable();
+            $grid->column('created_at');
+
+            $url = admin_url('/product/'.$this->product_id.'/spec');
+            $grid->tools('<a href="'.$url.'" class="btn btn-primary btn-outline" style="position: absolute;right: 118px;">
+<i class="fa fa-align-left"></i> 规格管理</a>');
+
+            $grid->disableViewButton();
+        });
+    }
+
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new ProductSpecGroup(), function (Form $form) {
+            $form->display('id');
+            $form->hidden('product_id')->value($this->product_id);
+            $form->text('name')->required();
+
+            $form->radio('is_opened')->options(config('global.bool_status'))->default(1);
+            $form->number('sort');
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
+        });
+    }
+}

+ 64 - 19
server/app/Admin/Controllers/ShowroomCaseController.php

xqd xqd xqd
@@ -2,6 +2,7 @@
 
 namespace App\Admin\Controllers;
 
+use App\Models\Showroom;
 use App\Models\ShowroomCase;
 use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
@@ -17,21 +18,42 @@ class ShowroomCaseController extends AdminController
      */
     protected function grid()
     {
-        return Grid::make(new ShowroomCase(), function (Grid $grid) {
+        return Grid::make(ShowroomCase::with('showroom'), function (Grid $grid) {
             $grid->column('id')->sortable();
-            $grid->column('showroom_id');
+            $grid->column('showroom_id','展厅名称')->display(function (){
+                return $this->showroom->name;
+            });
             $grid->column('name');
-            $grid->column('videos');
-            $grid->column('images');
-            $grid->column('sort');
-            $grid->column('is_opened');
+            $grid->column('videos')->display(function (){
+                $html = '';
+                foreach ($this->videos as $key => $video){
+                    $html .= "<video src='{$video}' width='200' controls>";
+                }
+                return $html;
+            });
+            $grid->column('images')->display(function (){
+                $html = '';
+                foreach ($this->images as $image){
+                    $html .= '<img data-action="preview-img" src="'.$image.'"
+style="max-width:80px;max-height:80px;cursor:pointer"
+class="img img-thumbnail">';
+                }
+                return $html;
+            });
+            $grid->column('sort')->editable();
+            $grid->column('is_opened')->switch();
             $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
+
             $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
+                $filter->panel();
+                $filter->like('name')->width(2);
+                $filter->equal('showroom_id','展厅')->select(function (){
+                    return Showroom::select(['id','name'])->get()->pluck('name','id')->toArray();
+                })->width(2);
+
             });
+
+            $grid->disableViewButton();
         });
     }
 
@@ -66,15 +88,38 @@ class ShowroomCaseController extends AdminController
     {
         return Form::make(new ShowroomCase(), function (Form $form) {
             $form->display('id');
-            $form->text('showroom_id');
-            $form->text('name');
-            $form->text('videos');
-            $form->text('images');
-            $form->text('sort');
-            $form->text('is_opened');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+            $cates = Showroom::select(['id','name'])
+                ->where('is_opened',1)->get()->toArray();
+            $form->select('showroom_id')
+                ->options(array_column($cates,'name','id'))
+                ->required();;
+            $form->text('name')->required();
+            $form->multipleFile('videos')->saveFullUrl()
+                ->mimeTypes('video/*')
+                ->chunkSize(4096)
+                ->maxSize(1024 * 1024)
+                ->uniqueName()
+                ->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->multipleImage('images')->saveFullUrl()
+                ->uniqueName()->autoUpload()
+                ->autoSave(false)
+                ->removable(false)
+                ->width(4);
+            $form->number('sort');
+            $form->radio('is_opened')
+                ->options(config('global.bool_status'))
+                ->default(1);
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
+
         });
     }
 }

+ 19 - 13
server/app/Admin/Controllers/ShowroomController.php

xqd xqd
@@ -18,16 +18,16 @@ class ShowroomController extends AdminController
     protected function grid()
     {
         return Grid::make(new Showroom(), function (Grid $grid) {
+            $grid->model()->orderByDesc('sort');
             $grid->column('id')->sortable();
             $grid->column('name');
-            $grid->column('sort');
-            $grid->column('is_opened');
-            $grid->column('created_at');
-            $grid->column('updated_at')->sortable();
-        
+            $grid->column('sort')->editable();
+            $grid->column('is_opened')->switch();
+
             $grid->filter(function (Grid\Filter $filter) {
-                $filter->equal('id');
-        
+                $filter->panel();
+                $filter->like('name')->width(2);
+
             });
         });
     }
@@ -60,12 +60,18 @@ class ShowroomController extends AdminController
     {
         return Form::make(new Showroom(), function (Form $form) {
             $form->display('id');
-            $form->text('name');
-            $form->text('sort');
-            $form->text('is_opened');
-        
-            $form->display('created_at');
-            $form->display('updated_at');
+            $form->text('name')->required();
+            $form->number('sort');
+            $form->radio('is_opened')
+                ->options(config('global.bool_status'))
+                ->default(1);
+
+            $form->disableViewButton();
+            $form->disableDeleteButton();
+            $form->disableListButton();
+            $form->disableEditingCheck();
+            $form->disableViewCheck();
+            $form->disableCreatingCheck();
         });
     }
 }

+ 0 - 16
server/app/Admin/Repositories/ProductHot.php

xqd
@@ -1,16 +0,0 @@
-<?php
-
-namespace App\Admin\Repositories;
-
-use App\Models\ProductHot as Model;
-use Dcat\Admin\Repositories\EloquentRepository;
-
-class ProductHot extends EloquentRepository
-{
-    /**
-     * Model.
-     *
-     * @var string
-     */
-    protected $eloquentClass = Model::class;
-}

+ 5 - 1
server/app/Admin/routes.php

xqd xqd
@@ -19,7 +19,7 @@ Route::group([
     $router->get('dashboard/download', 'DashBoardController@download');
 
     // 账号
-    $router->resource('account','UserController');
+    $router->resource('account','AccountController');
 
     // 产品管理
     $router->group(['prefix' => 'product'], function (Router $router){
@@ -27,6 +27,10 @@ Route::group([
         $router->resource('list','ProductController');
         // 产品分类
         $router->resource('categories','ProductCategoryController');
+        // 规格
+        $router->resource('{id}/spec','ProductSpecController');
+        // 规格组
+        $router->resource('{id}/specGroup','ProductSpecGroupController');
     });
     // 案例管理
     $router->group(['prefix' => 'cases'], function (Router $router){

+ 22 - 0
server/app/Casts/DelimiterCast.php

xqd
@@ -0,0 +1,22 @@
+<?php
+namespace App\Casts;
+
+use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
+
+class DelimiterCast  implements CastsAttributes
+{
+   public function get($model, string $key, $value, array $attributes)
+   {
+       $arr = explode(';', $value);
+       foreach ($arr as &$item){
+           $item = is_numeric($item) ? $item * 1: $item;
+       }
+       unset($item);
+       return $arr;
+   }
+
+    public function set($model, string $key, $value, array $attributes)
+    {
+        return collect($value)->implode(';');
+    }
+}

+ 14 - 0
server/app/Models/Account.php

xqd
@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Account extends Model
+{
+	use HasDateTimeFormatter;
+
+    protected $table = 'accounts';
+}

+ 17 - 0
server/app/Models/Product.php

xqd
@@ -48,9 +48,26 @@ use Illuminate\Database\Eloquent\Model;
  * @method static \Illuminate\Database\Query\Builder|Product withTrashed()
  * @method static \Illuminate\Database\Query\Builder|Product withoutTrashed()
  * @mixin \Eloquent
+ * @property int $cate_id 分类ID
+ * @property-read \App\Models\ProductCategory|null $cate
+ * @method static \Illuminate\Database\Eloquent\Builder|Product whereCateId($value)
  */
 class Product extends Model
 {
 	use HasDateTimeFormatter;
     use SoftDeletes;
+
+    protected $casts = [
+        'cases' => 'json',
+        'tech_param' => 'json',
+        'cad_model' => 'json',
+        'cad_design' => 'json',
+        'su_model' => 'json',
+        'other' => 'json',
+    ];
+
+    public function cate(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
+        return $this->belongsTo(ProductCategory::class,'cate_id','id');
     }
+ }

+ 7 - 1
server/app/Models/ProductCategory.php

xqd xqd
@@ -32,6 +32,7 @@ use Illuminate\Database\Eloquent\Model;
  * @method static \Illuminate\Database\Query\Builder|ProductCategory withTrashed()
  * @method static \Illuminate\Database\Query\Builder|ProductCategory withoutTrashed()
  * @mixin \Eloquent
+ * @property-read ProductCategory|null $parent
  */
 class ProductCategory extends Model
 {
@@ -39,5 +40,10 @@ class ProductCategory extends Model
     use SoftDeletes;
 
     protected $table = 'product_categories';
-    
+
+    public function parent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
+        return $this->belongsTo(ProductCategory::class,'pid','id');
+    }
+
 }

+ 10 - 1
server/app/Models/ProductHot.php

xqd xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Models;
 
 use Dcat\Admin\Traits\HasDateTimeFormatter;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Database\Eloquent\Model;
 
@@ -32,6 +33,9 @@ use Illuminate\Database\Eloquent\Model;
  * @method static \Illuminate\Database\Query\Builder|ProductHot withTrashed()
  * @method static \Illuminate\Database\Query\Builder|ProductHot withoutTrashed()
  * @mixin \Eloquent
+ * @property string $cover_img 爆款图片
+ * @property-read \App\Models\Product|null $product
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductHot whereCoverImg($value)
  */
 class ProductHot extends Model
 {
@@ -39,5 +43,10 @@ class ProductHot extends Model
     use SoftDeletes;
 
     protected $table = 'product_hots';
-    
+
+    public function product(): BelongsTo
+    {
+        return $this->belongsTo(Product::class,'product_id','id');
+    }
+
 }

+ 27 - 20
server/app/Models/ProductSku.php → server/app/Models/ProductSpec.php

xqd xqd
@@ -3,14 +3,15 @@
 namespace App\Models;
 
 use Dcat\Admin\Traits\HasDateTimeFormatter;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Database\Eloquent\Model;
 
 /**
- * App\Models\ProductSku
+ * App\Models\ProductSpec
  *
  * @property int $id
- * @property int $product_id 产品ID
+ * @property int $group_id 分组ID
  * @property string $name 名称
  * @property string $cover_img 封面图
  * @property string $origin_price 原价
@@ -18,28 +19,34 @@ use Illuminate\Database\Eloquent\Model;
  * @property \Illuminate\Support\Carbon|null $updated_at
  * @property \Illuminate\Support\Carbon|null $deleted_at
  * @property \Illuminate\Support\Carbon|null $created_at
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku newQuery()
- * @method static \Illuminate\Database\Query\Builder|ProductSku onlyTrashed()
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku query()
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereCoverImg($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereDeletedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereName($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereOriginPrice($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereProductId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereSalePrice($value)
- * @method static \Illuminate\Database\Eloquent\Builder|ProductSku whereUpdatedAt($value)
- * @method static \Illuminate\Database\Query\Builder|ProductSku withTrashed()
- * @method static \Illuminate\Database\Query\Builder|ProductSku withoutTrashed()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec newQuery()
+ * @method static \Illuminate\Database\Query\Builder|ProductSpec onlyTrashed()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec query()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereCoverImg($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereDeletedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereGroupId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereName($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereOriginPrice($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereSalePrice($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpec whereUpdatedAt($value)
+ * @method static \Illuminate\Database\Query\Builder|ProductSpec withTrashed()
+ * @method static \Illuminate\Database\Query\Builder|ProductSpec withoutTrashed()
  * @mixin \Eloquent
+ * @property-read \App\Models\ProductSpecGroup|null $group
  */
-class ProductSku extends Model
+class ProductSpec extends Model
 {
 	use HasDateTimeFormatter;
     use SoftDeletes;
 
-    protected $table = 'product_skus';
-    
+    protected $table = 'product_specs';
+
+    public function group(): BelongsTo
+    {
+        return $this->belongsTo(ProductSpecGroup::class,'group_id','id');
+    }
+
 }

+ 56 - 0
server/app/Models/ProductSpecGroup.php

xqd
@@ -0,0 +1,56 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * App\Models\ProductSpecGroup
+ *
+ * @property int $id
+ * @property int $product_id 产品ID
+ * @property string $name 名称
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @property \Illuminate\Support\Carbon|null $deleted_at
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup newQuery()
+ * @method static \Illuminate\Database\Query\Builder|ProductSpecGroup onlyTrashed()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup query()
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereDeletedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereName($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereProductId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ProductSpecGroup whereUpdatedAt($value)
+ * @method static \Illuminate\Database\Query\Builder|ProductSpecGroup withTrashed()
+ * @method static \Illuminate\Database\Query\Builder|ProductSpecGroup withoutTrashed()
+ * @mixin \Eloquent
+ * @property-read \App\Models\Product|null $product
+ * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductSpec[] $specs
+ * @property-read int|null $specs_count
+ */
+class ProductSpecGroup extends Model
+{
+	use HasDateTimeFormatter;
+    use SoftDeletes;
+
+    protected $table = 'product_spec_groups';
+
+
+    public function product(): BelongsTo
+    {
+        return $this->belongsTo(Product::class,'product_id','id');
+    }
+
+    public function specs(): HasMany
+    {
+        return $this->hasMany(ProductSpec::class,'group_id','id');
+    }
+
+}

+ 12 - 1
server/app/Models/ShowroomCase.php

xqd xqd
@@ -36,6 +36,7 @@ use Illuminate\Database\Eloquent\Model;
  * @method static \Illuminate\Database\Query\Builder|ShowroomCase withTrashed()
  * @method static \Illuminate\Database\Query\Builder|ShowroomCase withoutTrashed()
  * @mixin \Eloquent
+ * @property-read \App\Models\Showroom|null $showroom
  */
 class ShowroomCase extends Model
 {
@@ -43,5 +44,15 @@ class ShowroomCase extends Model
     use SoftDeletes;
 
     protected $table = 'showroom_cases';
-    
+
+    protected $casts = [
+        'videos' => 'json',
+        'images' => 'json',
+    ];
+
+    public function showroom(): \Illuminate\Database\Eloquent\Relations\BelongsTo
+    {
+        return $this->belongsTo(Showroom::class,'showroom_id','id');
+    }
+
 }

+ 5 - 35
server/config/global.php

xqd
@@ -4,41 +4,11 @@
  */
 return [
     // 平台
-    'platform' => [1 => '抖音', 2 => '快手'],
-    // 短剧状态
-    'episode_status' => ['持续更新中','已完结'],
-    // 短剧免费
-    'episode_free' => ['付费','免费'],
-    // 短剧上架状态
-    'episode_opend' => ['已下架','销售中'],
-    // 是否状态
-    'bool_status' => ['否','是'],
-    // 会员权限
-    'vip_role' => [ 1 => '会员可查看所有视频', 2 => '会员只能查看指定视频'],
-    // 会员权限
-    'open_sign' => ['关闭签到', '开启签到'],
-    // 消费类型
-    'consume_type' => [1 => '充值', 2 => '消费', 3 => '签到'],
+    'user_type' => [ 1=>'普通用户', 2=>'VIP', 3=>'设计师'],
+    //
+    'user_status' => [ 0=>'禁用', 1=>'启用'],
     // 分类
     'cat_level' => [1 => '一级分类', 2 => '二级分类'],
-    // 支付状态
-    'order_status' => [
-        0 =>'未付款',
-        1 =>'已完成',
-        2 =>'已取消',
-        3 => '已关闭'
-    ],
-    // 签到设置
-    'sign_config' => [
-        1 => ['name' => '第一天', 'award' => 3],
-        2 => ['name' => '第二天', 'award' => 6],
-        3 => ['name' => '第三天', 'award' => 10],
-        4 => ['name' => '第四天', 'award' => 15],
-        5 => ['name' => '第五天', 'award' => 20],
-        6 => ['name' => '第六天', 'award' => 30],
-        7 => ['name' => '第七天', 'award' => 50],
-    ],
-    'pay_type' => [
-        1 => '微信支付', 2  => '支付宝支付', 10 => '抖音支付', 11 => '快手支付'
-    ],
+    // 是否状态
+    'bool_status' => ['否','是'],
 ];

+ 48 - 28
server/dcat_admin_ide_helper.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -12,12 +12,17 @@ namespace Dcat\Admin {
 
     /**
      * @property Grid\Column|Collection id
-     * @property Grid\Column|Collection name
+     * @property Grid\Column|Collection user_name
+     * @property Grid\Column|Collection account
+     * @property Grid\Column|Collection password
      * @property Grid\Column|Collection type
-     * @property Grid\Column|Collection version
-     * @property Grid\Column|Collection detail
+     * @property Grid\Column|Collection remark
+     * @property Grid\Column|Collection status
      * @property Grid\Column|Collection created_at
      * @property Grid\Column|Collection updated_at
+     * @property Grid\Column|Collection name
+     * @property Grid\Column|Collection version
+     * @property Grid\Column|Collection detail
      * @property Grid\Column|Collection is_enabled
      * @property Grid\Column|Collection parent_id
      * @property Grid\Column|Collection order
@@ -33,7 +38,6 @@ namespace Dcat\Admin {
      * @property Grid\Column|Collection user_id
      * @property Grid\Column|Collection value
      * @property Grid\Column|Collection username
-     * @property Grid\Column|Collection password
      * @property Grid\Column|Collection avatar
      * @property Grid\Column|Collection remember_token
      * @property Grid\Column|Collection image
@@ -48,10 +52,12 @@ namespace Dcat\Admin {
      * @property Grid\Column|Collection token
      * @property Grid\Column|Collection level
      * @property Grid\Column|Collection pid
-     * @property Grid\Column|Collection product_id
      * @property Grid\Column|Collection cover_img
+     * @property Grid\Column|Collection product_id
+     * @property Grid\Column|Collection group_id
      * @property Grid\Column|Collection origin_price
      * @property Grid\Column|Collection sale_price
+     * @property Grid\Column|Collection cate_id
      * @property Grid\Column|Collection cases
      * @property Grid\Column|Collection tech_param
      * @property Grid\Column|Collection cad_model
@@ -66,17 +72,21 @@ namespace Dcat\Admin {
      * @property Grid\Column|Collection mobile
      * @property Grid\Column|Collection open_id
      * @property Grid\Column|Collection union_id
-     * @property Grid\Column|Collection status
+     * @property Grid\Column|Collection account_id
      * @property Grid\Column|Collection email_verified_at
-     * @property Grid\Column|Collection remark
      *
      * @method Grid\Column|Collection id(string $label = null)
-     * @method Grid\Column|Collection name(string $label = null)
+     * @method Grid\Column|Collection user_name(string $label = null)
+     * @method Grid\Column|Collection account(string $label = null)
+     * @method Grid\Column|Collection password(string $label = null)
      * @method Grid\Column|Collection type(string $label = null)
-     * @method Grid\Column|Collection version(string $label = null)
-     * @method Grid\Column|Collection detail(string $label = null)
+     * @method Grid\Column|Collection remark(string $label = null)
+     * @method Grid\Column|Collection status(string $label = null)
      * @method Grid\Column|Collection created_at(string $label = null)
      * @method Grid\Column|Collection updated_at(string $label = null)
+     * @method Grid\Column|Collection name(string $label = null)
+     * @method Grid\Column|Collection version(string $label = null)
+     * @method Grid\Column|Collection detail(string $label = null)
      * @method Grid\Column|Collection is_enabled(string $label = null)
      * @method Grid\Column|Collection parent_id(string $label = null)
      * @method Grid\Column|Collection order(string $label = null)
@@ -92,7 +102,6 @@ namespace Dcat\Admin {
      * @method Grid\Column|Collection user_id(string $label = null)
      * @method Grid\Column|Collection value(string $label = null)
      * @method Grid\Column|Collection username(string $label = null)
-     * @method Grid\Column|Collection password(string $label = null)
      * @method Grid\Column|Collection avatar(string $label = null)
      * @method Grid\Column|Collection remember_token(string $label = null)
      * @method Grid\Column|Collection image(string $label = null)
@@ -107,10 +116,12 @@ namespace Dcat\Admin {
      * @method Grid\Column|Collection token(string $label = null)
      * @method Grid\Column|Collection level(string $label = null)
      * @method Grid\Column|Collection pid(string $label = null)
-     * @method Grid\Column|Collection product_id(string $label = null)
      * @method Grid\Column|Collection cover_img(string $label = null)
+     * @method Grid\Column|Collection product_id(string $label = null)
+     * @method Grid\Column|Collection group_id(string $label = null)
      * @method Grid\Column|Collection origin_price(string $label = null)
      * @method Grid\Column|Collection sale_price(string $label = null)
+     * @method Grid\Column|Collection cate_id(string $label = null)
      * @method Grid\Column|Collection cases(string $label = null)
      * @method Grid\Column|Collection tech_param(string $label = null)
      * @method Grid\Column|Collection cad_model(string $label = null)
@@ -125,9 +136,8 @@ namespace Dcat\Admin {
      * @method Grid\Column|Collection mobile(string $label = null)
      * @method Grid\Column|Collection open_id(string $label = null)
      * @method Grid\Column|Collection union_id(string $label = null)
-     * @method Grid\Column|Collection status(string $label = null)
+     * @method Grid\Column|Collection account_id(string $label = null)
      * @method Grid\Column|Collection email_verified_at(string $label = null)
-     * @method Grid\Column|Collection remark(string $label = null)
      */
     class Grid {}
 
@@ -135,12 +145,17 @@ namespace Dcat\Admin {
 
     /**
      * @property Show\Field|Collection id
-     * @property Show\Field|Collection name
+     * @property Show\Field|Collection user_name
+     * @property Show\Field|Collection account
+     * @property Show\Field|Collection password
      * @property Show\Field|Collection type
-     * @property Show\Field|Collection version
-     * @property Show\Field|Collection detail
+     * @property Show\Field|Collection remark
+     * @property Show\Field|Collection status
      * @property Show\Field|Collection created_at
      * @property Show\Field|Collection updated_at
+     * @property Show\Field|Collection name
+     * @property Show\Field|Collection version
+     * @property Show\Field|Collection detail
      * @property Show\Field|Collection is_enabled
      * @property Show\Field|Collection parent_id
      * @property Show\Field|Collection order
@@ -156,7 +171,6 @@ namespace Dcat\Admin {
      * @property Show\Field|Collection user_id
      * @property Show\Field|Collection value
      * @property Show\Field|Collection username
-     * @property Show\Field|Collection password
      * @property Show\Field|Collection avatar
      * @property Show\Field|Collection remember_token
      * @property Show\Field|Collection image
@@ -171,10 +185,12 @@ namespace Dcat\Admin {
      * @property Show\Field|Collection token
      * @property Show\Field|Collection level
      * @property Show\Field|Collection pid
-     * @property Show\Field|Collection product_id
      * @property Show\Field|Collection cover_img
+     * @property Show\Field|Collection product_id
+     * @property Show\Field|Collection group_id
      * @property Show\Field|Collection origin_price
      * @property Show\Field|Collection sale_price
+     * @property Show\Field|Collection cate_id
      * @property Show\Field|Collection cases
      * @property Show\Field|Collection tech_param
      * @property Show\Field|Collection cad_model
@@ -189,17 +205,21 @@ namespace Dcat\Admin {
      * @property Show\Field|Collection mobile
      * @property Show\Field|Collection open_id
      * @property Show\Field|Collection union_id
-     * @property Show\Field|Collection status
+     * @property Show\Field|Collection account_id
      * @property Show\Field|Collection email_verified_at
-     * @property Show\Field|Collection remark
      *
      * @method Show\Field|Collection id(string $label = null)
-     * @method Show\Field|Collection name(string $label = null)
+     * @method Show\Field|Collection user_name(string $label = null)
+     * @method Show\Field|Collection account(string $label = null)
+     * @method Show\Field|Collection password(string $label = null)
      * @method Show\Field|Collection type(string $label = null)
-     * @method Show\Field|Collection version(string $label = null)
-     * @method Show\Field|Collection detail(string $label = null)
+     * @method Show\Field|Collection remark(string $label = null)
+     * @method Show\Field|Collection status(string $label = null)
      * @method Show\Field|Collection created_at(string $label = null)
      * @method Show\Field|Collection updated_at(string $label = null)
+     * @method Show\Field|Collection name(string $label = null)
+     * @method Show\Field|Collection version(string $label = null)
+     * @method Show\Field|Collection detail(string $label = null)
      * @method Show\Field|Collection is_enabled(string $label = null)
      * @method Show\Field|Collection parent_id(string $label = null)
      * @method Show\Field|Collection order(string $label = null)
@@ -215,7 +235,6 @@ namespace Dcat\Admin {
      * @method Show\Field|Collection user_id(string $label = null)
      * @method Show\Field|Collection value(string $label = null)
      * @method Show\Field|Collection username(string $label = null)
-     * @method Show\Field|Collection password(string $label = null)
      * @method Show\Field|Collection avatar(string $label = null)
      * @method Show\Field|Collection remember_token(string $label = null)
      * @method Show\Field|Collection image(string $label = null)
@@ -230,10 +249,12 @@ namespace Dcat\Admin {
      * @method Show\Field|Collection token(string $label = null)
      * @method Show\Field|Collection level(string $label = null)
      * @method Show\Field|Collection pid(string $label = null)
-     * @method Show\Field|Collection product_id(string $label = null)
      * @method Show\Field|Collection cover_img(string $label = null)
+     * @method Show\Field|Collection product_id(string $label = null)
+     * @method Show\Field|Collection group_id(string $label = null)
      * @method Show\Field|Collection origin_price(string $label = null)
      * @method Show\Field|Collection sale_price(string $label = null)
+     * @method Show\Field|Collection cate_id(string $label = null)
      * @method Show\Field|Collection cases(string $label = null)
      * @method Show\Field|Collection tech_param(string $label = null)
      * @method Show\Field|Collection cad_model(string $label = null)
@@ -248,9 +269,8 @@ namespace Dcat\Admin {
      * @method Show\Field|Collection mobile(string $label = null)
      * @method Show\Field|Collection open_id(string $label = null)
      * @method Show\Field|Collection union_id(string $label = null)
-     * @method Show\Field|Collection status(string $label = null)
+     * @method Show\Field|Collection account_id(string $label = null)
      * @method Show\Field|Collection email_verified_at(string $label = null)
-     * @method Show\Field|Collection remark(string $label = null)
      */
     class Show {}
 

+ 18 - 0
server/resources/lang/zh/account.php

xqd
@@ -0,0 +1,18 @@
+
+<?php
+return [
+    'labels' => [
+        'Account' => '账号',
+        'account' => '账号',
+    ],
+    'fields' => [
+        'user_name' => '用户名',
+        'account' => '账号',
+        'password' => '密码',
+        'type' => '用户类型',
+        'remark' => '备注',
+        'status' => '状态',
+    ],
+    'options' => [
+    ],
+];

+ 3 - 1
server/resources/lang/zh/product-category.php

xqd
@@ -3,12 +3,14 @@ return [
     'labels' => [
         'product' => '产品',
         'categories' => '分类',
+        'ProductCategory' => '产品分类',
     ],
     'fields' => [
         'name' => '名称',
         'level' => '分类级别',
         'pid' => '父分类',
-        'sort' => '排序(越大越靠前)',
+        'sort' => '排序',
+        'is_opened' => '是否启用',
     ],
     'options' => [
     ],

+ 1 - 0
server/resources/lang/zh/product-hot.php

xqd
@@ -9,6 +9,7 @@ return [
     ],
     'fields' => [
         'type' => '1- 普通用户 2-vip客户/设计师',
+        'cover_img' => '爆款图片',
         'product_id' => '产品',
         'sort' => '排序(越大越靠前)',
         'is_opened' => '是否启用',

+ 17 - 0
server/resources/lang/zh/product-spec-group.php

xqd
@@ -0,0 +1,17 @@
+<?php
+return [
+    'labels' => [
+        'ProductSpecGroup' => '产品规格组',
+        'product-spec-group' => '产品规格组',
+        'product' => '产品',
+        'specGroup' => '规格组',
+    ],
+    'fields' => [
+        'product_id' => '产品名称',
+        'name' => '名称',
+        'sort' => '排序(越大越靠前)',
+        'is_opened' => '是否启用',
+    ],
+    'options' => [
+    ],
+];

+ 20 - 0
server/resources/lang/zh/product-spec.php

xqd
@@ -0,0 +1,20 @@
+<?php
+return [
+    'labels' => [
+        'ProductSpec' => '产品规格',
+        'product-spec' => '产品规格',
+        'product' => '产品',
+        'spec' => '规格',
+    ],
+    'fields' => [
+        'group_id' => '规格分组',
+        'name' => '名称',
+        'cover_img' => '封面图',
+        'origin_price' => '原价',
+        'sale_price' => '价格',
+        'sort' => '排序(越大越靠前)',
+        'is_opened' => '是否启用',
+    ],
+    'options' => [
+    ],
+];

+ 3 - 2
server/resources/lang/zh/product.php

xqd
@@ -5,8 +5,9 @@ return [
         'product' => '产品',
     ],
     'fields' => [
-        'name' => '名称',
-        'cover_img' => '封面图',
+        'name' => '产品名称',
+        'cate_id' => '产品分类',
+        'cover_img' => '产品截面图',
         'cases' => '案例',
         'origin_price' => '原价',
         'sale_price' => '现价',

+ 17 - 0
server/resources/lang/zh_CN/account.php

xqd
@@ -0,0 +1,17 @@
+<?php 
+return [
+    'labels' => [
+        'Account' => 'Account',
+        'account' => 'Account',
+    ],
+    'fields' => [
+        'user_name' => '用户名',
+        'account' => '账号',
+        'password' => '密码',
+        'type' => '用户类型 1-普通用户 2-VIP 3-设计师',
+        'remark' => '备注',
+        'status' => '状态 1-正常 0-禁用',
+    ],
+    'options' => [
+    ],
+];

+ 13 - 0
server/resources/lang/zh_CN/product-spec-group.php

xqd
@@ -0,0 +1,13 @@
+<?php 
+return [
+    'labels' => [
+        'ProductSpecGroup' => 'ProductSpecGroup',
+        'product-spec-group' => 'ProductSpecGroup',
+    ],
+    'fields' => [
+        'product_id' => '产品ID',
+        'name' => '名称',
+    ],
+    'options' => [
+    ],
+];

+ 16 - 0
server/resources/lang/zh_CN/product-spec.php

xqd
@@ -0,0 +1,16 @@
+<?php 
+return [
+    'labels' => [
+        'ProductSpec' => 'ProductSpec',
+        'product-spec' => 'ProductSpec',
+    ],
+    'fields' => [
+        'group_id' => '分组ID',
+        'name' => '名称',
+        'cover_img' => '封面图',
+        'origin_price' => '原价',
+        'sale_price' => '现价',
+    ],
+    'options' => [
+    ],
+];