弹幕、分类下拉、属性下拉、
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\logic\PostCategoryLogic;
|
||||
use app\common\logic\SkuAttributeLogic;
|
||||
use app\common\validate\SkuAttributeValidate;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\SkuAttribute;
|
||||
@@ -12,6 +14,7 @@ class SkuAttributeService
|
||||
|
||||
use CrudServiceTrait;
|
||||
|
||||
protected $logic;
|
||||
/**
|
||||
* 指定当前要操作的模型
|
||||
*/
|
||||
@@ -22,6 +25,11 @@ class SkuAttributeService
|
||||
*/
|
||||
protected $validator = SkuAttributeValidate::class;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logic = (new SkuAttributeLogic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证器
|
||||
*/
|
||||
@@ -58,4 +66,43 @@ class SkuAttributeService
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加前置处理
|
||||
*/
|
||||
public function beforeServiceStore($data, Request $request)
|
||||
{
|
||||
// $options = [];
|
||||
// foreach ($data['options_json'] as $v){
|
||||
// $options[] = $v['value'];
|
||||
// }
|
||||
// $data['options_json'] = json_encode($options, JSON_UNESCAPED_UNICODE);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加前置处理
|
||||
*/
|
||||
public function beforeServiceUpdate($data, Request $request)
|
||||
{
|
||||
// $options = [];
|
||||
// foreach ($data['options_json'] as $v){
|
||||
// $options[] = $v['value'];
|
||||
// }
|
||||
// $data['options_json'] = json_encode($options, JSON_UNESCAPED_UNICODE);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统list
|
||||
*/
|
||||
public function preset($params)
|
||||
{
|
||||
$where = [];
|
||||
if(isset($params['category_id']) && $params['category_id']) {
|
||||
$where['category_id'] = $params['category_id'];
|
||||
}
|
||||
$result = $this->logic->getList($where)->toArray();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user