refactor: 修改导航新增唯一标识处理
This commit is contained in:
@@ -75,12 +75,16 @@ class Navigation
|
|||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
$post = request()->post([
|
$post = request()->post([
|
||||||
|
'unique_label' => '',
|
||||||
'name',
|
'name',
|
||||||
'at_platform' => 'pc',
|
'at_platform' => 'pc',
|
||||||
'desc',
|
'desc',
|
||||||
'status' => 1
|
'status' => 1
|
||||||
]);
|
]);
|
||||||
$data = array_merge($post, ['language_id' => request()->lang_id, 'unique_label' => uniqid("NAV_")]);
|
if (empty($post['unique_label'])) {
|
||||||
|
$post['unique_label'] = uniqid("NAV_");
|
||||||
|
}
|
||||||
|
$data = array_merge($post, ['language_id' => request()->lang_id]);
|
||||||
|
|
||||||
$validate = new NavigationValidate;
|
$validate = new NavigationValidate;
|
||||||
if (!$validate->scene('add')->check($data)) {
|
if (!$validate->scene('add')->check($data)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user