弹幕屏蔽
This commit is contained in:
@@ -31,6 +31,41 @@ class BarrageService
|
||||
return new $this->validator;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造 CrudUtil 查询配置
|
||||
*/
|
||||
protected function buildQueryConfig(Request $request, string $scene = 'default'): array
|
||||
{
|
||||
$p = $request->all();
|
||||
|
||||
$config = [];
|
||||
$config['model'] = $this->modelClass;
|
||||
switch ($scene) {
|
||||
case 'default':
|
||||
$config['order']['sort'] = 'desc';
|
||||
$config['order']['id'] = 'desc';
|
||||
break;
|
||||
case 'index':
|
||||
$config['order']['is_blocked'] = '0';
|
||||
$config['order']['sort'] = 'desc';
|
||||
$config['order']['id'] = 'desc';
|
||||
break;
|
||||
case 'show':
|
||||
$config['where']['id'] = $p['id'];
|
||||
$config['where']['status'] = 1;
|
||||
break;
|
||||
case 'store':
|
||||
break;
|
||||
case 'update':
|
||||
$config['where']['id'] = $p['id'];
|
||||
break;
|
||||
case 'destroy':
|
||||
$config['where']['id'] = $p['id'];
|
||||
break;
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加前置处理
|
||||
|
||||
@@ -72,11 +72,11 @@ class SkuAttributeService
|
||||
*/
|
||||
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);
|
||||
$options = [];
|
||||
foreach ($data['options_json'] as $v){
|
||||
$options[] = $v['value'];
|
||||
}
|
||||
$data['options_json'] = json_encode($options, JSON_UNESCAPED_UNICODE);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user