调整后台商品基础管理
parent
37d19470a9
commit
793e2511d3
|
|
@ -64,13 +64,14 @@ class ArticleController extends AdminController
|
|||
//新增
|
||||
if (Admin::user()->can('dcat.admin.articles.create')) {
|
||||
$grid->disableCreateButton(false);
|
||||
$grid->enableDialogCreate();
|
||||
// $grid->enableDialogCreate();
|
||||
}
|
||||
//修改
|
||||
$grid->showQuickEditButton(Admin::user()->can('dcat.admin.articles.edit'));
|
||||
|
||||
//删除以及自定义操作
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableDelete(Admin::user()->cannot('dcat.admin.articles.destroy'));
|
||||
//修改
|
||||
$actions->disableEdit(Admin::user()->cannot('dcat.admin.articles.edit'));
|
||||
});
|
||||
|
||||
/** 查询 **/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\ProductAttr;
|
||||
use App\Models\ProductAttrGroup;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class ProductAttrController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = ProductAttr::with('group');
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('group.name');
|
||||
$grid->column('name');
|
||||
$grid->column('attrs')->label();
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
//排序
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
|
||||
/** 操作 **/
|
||||
//新增
|
||||
if (Admin::user()->can('dcat.admin.product_attrs.create')) {
|
||||
$grid->disableCreateButton(false);
|
||||
$grid->enableDialogCreate();
|
||||
}
|
||||
|
||||
//修改
|
||||
$grid->showQuickEditButton(Admin::user()->can('dcat.admin.product_attrs.edit'));
|
||||
//删除以及自定义操作
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableDelete(Admin::user()->cannot('dcat.admin.product_attrs.destroy'));
|
||||
});
|
||||
|
||||
/** 查询 **/
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->where('group', function ($query) {
|
||||
$query->whereIn('group_id', ProductAttrGroup::descendantsAndSelf($this->input, ['id'])->pluck('id'));
|
||||
}, __('product-attr.fields.group.name'))->select(ProductAttrGroup::selectOptions())->width(3);
|
||||
$filter->like('title')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new ProductAttr(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('group_id');
|
||||
$show->field('attrs');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new ProductAttr(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->select('group_id')->options(ProductAttrGroup::selectOptions());
|
||||
$form->text('name')->required();
|
||||
$form->list('attrs');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\ProductAttrGroup;
|
||||
use App\Exceptions\BizException;
|
||||
use App\Models\ProductAttr;
|
||||
use App\Models\ProductAttrGroup as ProductAttrGroupModel;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class ProductAttrGroupController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(new ProductAttrGroup(), function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('name')->tree();
|
||||
$grid->column('parent_id');
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
//排序
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
|
||||
/** 操作 **/
|
||||
//新增
|
||||
if (Admin::user()->can('dcat.admin.product_attr_groups.create')) {
|
||||
$grid->disableCreateButton(false);
|
||||
$grid->enableDialogCreate();
|
||||
}
|
||||
//修改
|
||||
$grid->showQuickEditButton(Admin::user()->can('dcat.admin.product_attr_groups.edit'));
|
||||
//删除以及自定义操作
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableDelete(Admin::user()->cannot('dcat.admin.product_attr_groups.destroy'));
|
||||
});
|
||||
|
||||
/** 查询 **/
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->equal('name')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new ProductAttrGroup(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('name');
|
||||
$show->field('parent_id');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new ProductAttrGroup(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->select('parent_id')->options(ProductAttrGroupModel::selectOptions());
|
||||
$form->text('name');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
//如果有子分类或者分类下有文章则不允许删除
|
||||
if (ProductAttrGroupModel::descendantsOf($id, ['id'])->count() > 0
|
||||
|| ProductAttr::where('category_id', $id)->count() > 0) {
|
||||
throw new BizException(__('product-attr-group.options.deny_message'));
|
||||
}
|
||||
return parent::destroy($id);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,9 @@
|
|||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\ProductCategory;
|
||||
use App\Exceptions\BizException;
|
||||
use App\Models\ProductCategory as ProductCategoryModel;
|
||||
use App\Models\ProductSpu;
|
||||
use Carbon\Carbon;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
|
|
@ -117,4 +119,14 @@ class ProductCategoryController extends AdminController
|
|||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
//如果有子分类或者分类下有文章则不允许删除
|
||||
if (ProductCategoryModel::descendantsOf($id, ['id'])->count() > 0
|
||||
|| ProductSpu::where('category_id', $id)->count() > 0) {
|
||||
throw new BizException(__('product-spu.options.deny_message'));
|
||||
}
|
||||
return parent::destroy($id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\ProductSpu;
|
||||
use App\Models\ProductCategory;
|
||||
use Carbon\Carbon;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class ProductSpuController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(new ProductSpu(), function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('name');
|
||||
$grid->column('subtitle');
|
||||
$grid->column('cover')->image(80, 80);
|
||||
$grid->column('sell_price');
|
||||
$grid->column('market_price');
|
||||
$grid->column('cost_price');
|
||||
$grid->column('user_price');
|
||||
$grid->column('weight');
|
||||
$grid->column('is_sell');
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
//排序
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
|
||||
/** 操作 **/
|
||||
//新增
|
||||
if (Admin::user()->can('dcat.admin.product_spus.create')) {
|
||||
$grid->disableCreateButton(false);
|
||||
}
|
||||
//修改
|
||||
$grid->showQuickEditButton(Admin::user()->can('dcat.admin.product_spus.edit'));
|
||||
//删除以及自定义操作
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableDelete(Admin::user()->cannot('dcat.admin.product_spus.destroy'));
|
||||
});
|
||||
|
||||
/** 查询 **/
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->equal('name')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new ProductSpu(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('name');
|
||||
$show->field('subtitle');
|
||||
$show->field('cover');
|
||||
$show->field('images');
|
||||
$show->field('description');
|
||||
$show->field('sell_price');
|
||||
$show->field('market_price');
|
||||
$show->field('cost_price');
|
||||
$show->field('user_price');
|
||||
$show->field('media');
|
||||
$show->field('weight');
|
||||
$show->field('attrs');
|
||||
$show->field('is_sell');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new ProductSpu(), function (Form $form) {
|
||||
$form->display('id');
|
||||
|
||||
if ($form->isEditing()) {
|
||||
return;
|
||||
}
|
||||
$form->select('category_id')->options(ProductCategory::selectOptions())->required();
|
||||
$form->text('name')->required();
|
||||
$form->text('subtitle');
|
||||
$form->image('cover')
|
||||
->move('product-spus/cover/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
$form->multipleImage('images')
|
||||
->move('product-spus/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
$form->editor('description');
|
||||
$form->number('weight');
|
||||
|
||||
$form->currency('sell_price')->symbol('¥');
|
||||
$form->currency('market_price')->symbol('¥');
|
||||
$form->currency('cost_price')->symbol('¥');
|
||||
$form->currency('user_price')->symbol('¥');
|
||||
$form->switch('is_sell');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\ProductAttr as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class ProductAttr extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\ProductAttrGroup as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class ProductAttrGroup extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\ProductSpu as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class ProductSpu extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -38,4 +38,14 @@ Route::group([
|
|||
$router->resource('product-specs', 'ProductSpecController')->only([
|
||||
'index', 'create', 'store', 'edit', 'update', 'destroy',
|
||||
])->names('product_specs');
|
||||
|
||||
$router->resource('product-attr-groups', 'ProductAttrGroupController')->only([
|
||||
'index', 'create', 'store', 'edit', 'update', 'destroy',
|
||||
])->names('product_attr_groups');
|
||||
|
||||
$router->resource('product-attrs', 'ProductAttrController')->only([
|
||||
'index', 'create', 'store', 'edit', 'update', 'destroy',
|
||||
])->names('product_attrs');
|
||||
|
||||
$router->resource('product-spus', 'ProductSpuController')->names('product_spus');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Casts;
|
||||
|
||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||
|
||||
class PriceAttributes implements CastsAttributes
|
||||
{
|
||||
/**
|
||||
* Cast the given value.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Model $model
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($model, string $key, $value, array $attributes)
|
||||
{
|
||||
return bcdiv($value, 100, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the given value for storage.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Model $model
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
*/
|
||||
public function set($model, string $key, $value, array $attributes)
|
||||
{
|
||||
return (int) bcmul($value, 100);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductAttr extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
protected $table = 'product_attrs';
|
||||
|
||||
protected $casts = [
|
||||
'attrs'=> 'array',
|
||||
];
|
||||
|
||||
public function group()
|
||||
{
|
||||
return $this->belongsTo(ProductAttrGroup::class, 'group_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
|
||||
use Dcat\Admin\Traits\ModelTree;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Kalnoy\Nestedset\NodeTrait;
|
||||
|
||||
class ProductAttrGroup extends Model
|
||||
{
|
||||
use NodeTrait;
|
||||
use ModelTree;
|
||||
use HasDateTimeFormatter;
|
||||
protected $table = 'product_attr_groups';
|
||||
|
||||
// 排序字段名称,默认值为 order
|
||||
protected $orderColumn = 'sort';
|
||||
|
||||
// 标题字段名称,默认值为 title
|
||||
protected $titleColumn = 'name';
|
||||
|
||||
public function getDefaultParentId()
|
||||
{
|
||||
return $this->parent_id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Casts\PriceAttributes;
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductSpu extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
protected $table = 'product_spus';
|
||||
|
||||
protected $casts = [
|
||||
'sell_price'=>PriceAttributes::class,
|
||||
'market_price'=>PriceAttributes::class,
|
||||
'cost_price'=>PriceAttributes::class,
|
||||
'user_price'=>PriceAttributes::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ class CreateProductSpusTable extends Migration
|
|||
$table->id();
|
||||
$table->string('name')->comment('商品名称');
|
||||
$table->string('subtitle')->nullable()->comment('商品副标题');
|
||||
$table->unsignedBigInteger('category_id')->comment('商品分类');
|
||||
$table->string('cover')->nullable()->comment('封面图');
|
||||
$table->json('images')->nullable()->comment('商品图片');
|
||||
$table->text('description')->nullable()->comment('商品详情');
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class CreateProductSkusTable extends Migration
|
|||
$table->unsignedBigInteger('spu_id')->comment('主商品ID');
|
||||
$table->string('name')->comment('商品名称');
|
||||
$table->string('subtitle')->nullable()->comment('商品副标题');
|
||||
$table->unsignedBigInteger('category_id')->comment('商品分类');
|
||||
$table->string('cover')->nullable()->comment('封面图');
|
||||
$table->json('images')->nullable()->comment('商品图片');
|
||||
$table->text('description')->nullable()->comment('商品详情');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProductAttrGroupsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('product_attr_groups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->comment('名称');
|
||||
$table->integer('sort')->default(0)->comment('排序');
|
||||
$table->nestedSet();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('product_attr_groups');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProductAttrsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('product_attrs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('group_id')->nullable()->comment('属性分组');
|
||||
$table->string('name')->comment('名称');
|
||||
$table->json('attrs')->nullable()->comment('属性');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('product_attrs');
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +63,8 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection token
|
||||
* @property Grid\Column|Collection abilities
|
||||
* @property Grid\Column|Collection last_used_at
|
||||
* @property Grid\Column|Collection group_id
|
||||
* @property Grid\Column|Collection attrs
|
||||
* @property Grid\Column|Collection spu_id
|
||||
* @property Grid\Column|Collection images
|
||||
* @property Grid\Column|Collection sell_price
|
||||
|
|
@ -71,7 +73,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection user_price
|
||||
* @property Grid\Column|Collection media
|
||||
* @property Grid\Column|Collection weight
|
||||
* @property Grid\Column|Collection attrs
|
||||
* @property Grid\Column|Collection is_sell
|
||||
* @property Grid\Column|Collection spec_items
|
||||
* @property Grid\Column|Collection stock
|
||||
|
|
@ -147,6 +148,8 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection token(string $label = null)
|
||||
* @method Grid\Column|Collection abilities(string $label = null)
|
||||
* @method Grid\Column|Collection last_used_at(string $label = null)
|
||||
* @method Grid\Column|Collection group_id(string $label = null)
|
||||
* @method Grid\Column|Collection attrs(string $label = null)
|
||||
* @method Grid\Column|Collection spu_id(string $label = null)
|
||||
* @method Grid\Column|Collection images(string $label = null)
|
||||
* @method Grid\Column|Collection sell_price(string $label = null)
|
||||
|
|
@ -155,7 +158,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection user_price(string $label = null)
|
||||
* @method Grid\Column|Collection media(string $label = null)
|
||||
* @method Grid\Column|Collection weight(string $label = null)
|
||||
* @method Grid\Column|Collection attrs(string $label = null)
|
||||
* @method Grid\Column|Collection is_sell(string $label = null)
|
||||
* @method Grid\Column|Collection spec_items(string $label = null)
|
||||
* @method Grid\Column|Collection stock(string $label = null)
|
||||
|
|
@ -236,6 +238,8 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection token
|
||||
* @property Show\Field|Collection abilities
|
||||
* @property Show\Field|Collection last_used_at
|
||||
* @property Show\Field|Collection group_id
|
||||
* @property Show\Field|Collection attrs
|
||||
* @property Show\Field|Collection spu_id
|
||||
* @property Show\Field|Collection images
|
||||
* @property Show\Field|Collection sell_price
|
||||
|
|
@ -244,7 +248,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection user_price
|
||||
* @property Show\Field|Collection media
|
||||
* @property Show\Field|Collection weight
|
||||
* @property Show\Field|Collection attrs
|
||||
* @property Show\Field|Collection is_sell
|
||||
* @property Show\Field|Collection spec_items
|
||||
* @property Show\Field|Collection stock
|
||||
|
|
@ -320,6 +323,8 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection token(string $label = null)
|
||||
* @method Show\Field|Collection abilities(string $label = null)
|
||||
* @method Show\Field|Collection last_used_at(string $label = null)
|
||||
* @method Show\Field|Collection group_id(string $label = null)
|
||||
* @method Show\Field|Collection attrs(string $label = null)
|
||||
* @method Show\Field|Collection spu_id(string $label = null)
|
||||
* @method Show\Field|Collection images(string $label = null)
|
||||
* @method Show\Field|Collection sell_price(string $label = null)
|
||||
|
|
@ -328,7 +333,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection user_price(string $label = null)
|
||||
* @method Show\Field|Collection media(string $label = null)
|
||||
* @method Show\Field|Collection weight(string $label = null)
|
||||
* @method Show\Field|Collection attrs(string $label = null)
|
||||
* @method Show\Field|Collection is_sell(string $label = null)
|
||||
* @method Show\Field|Collection spec_items(string $label = null)
|
||||
* @method Show\Field|Collection stock(string $label = null)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
.tox {z-index:99999999}
|
||||
/* .tox {z-index:99999999} */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'ProductAttrGroup' => '属性分组',
|
||||
'product-attr-groups' => '属性分组',
|
||||
],
|
||||
'fields' => [
|
||||
'name' => '名称',
|
||||
'parent_id' => '上级',
|
||||
],
|
||||
'options' => [
|
||||
'deny' => '删除失败',
|
||||
'deny_message'=>'请先删除该分类下的子分类或者属性',
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'ProductAttr' => '属性管理',
|
||||
'product-attr' => '属性管理',
|
||||
],
|
||||
'fields' => [
|
||||
'group' => [
|
||||
'name' => '属性分组',
|
||||
],
|
||||
'group_id' => '属性分组',
|
||||
'attrs' => '属性',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -14,5 +14,7 @@ return [
|
|||
'parent_id' => '父级',
|
||||
],
|
||||
'options' => [
|
||||
'deny' => '删除失败',
|
||||
'deny_message'=>'请先删除该分类下的子分类或者主商品',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'ProductSpu' => '主商品',
|
||||
'product-spus' => '主商品',
|
||||
],
|
||||
'fields' => [
|
||||
'category_id'=>'商品分类',
|
||||
'name' => '商品名称',
|
||||
'subtitle' => '商品副标题',
|
||||
'cover' => '封面图',
|
||||
'images' => '商品图片',
|
||||
'description' => '商品详情',
|
||||
'sell_price' => '销售价格',
|
||||
'market_price' => '市场价格',
|
||||
'cost_price' => '成本价格',
|
||||
'user_price' => '会员价格',
|
||||
'media' => '媒体地址',
|
||||
'weight' => '重量:g',
|
||||
'attrs' => '属性文本',
|
||||
'is_sell' => '在售状态',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue