|
@@ -128,6 +128,7 @@ class FooterService implements FooterServiceInterface
|
|
|
if (!$footer_category) {
|
|
|
return Result::error("该底部导航不存在!");
|
|
|
}else{
|
|
|
+
|
|
|
$result = FooterCategory::where('footer_category.id',$data['id'])
|
|
|
->leftJoin("footer_content","footer_content.fcat_id","footer_category.id")
|
|
|
->delete();
|
|
@@ -148,17 +149,6 @@ class FooterService implements FooterServiceInterface
|
|
|
{
|
|
|
// 底部导航类型 0:内容型;1:列表型;
|
|
|
// var_dump($data);
|
|
|
- if($data['type'] == 0){
|
|
|
- $countent = FooterContent::where('fcat_id', $data['fcat_id'])->first();
|
|
|
- if(!empty($countent)){
|
|
|
- return Result::error("该底部导航内容已存在!");
|
|
|
- }
|
|
|
- }else{
|
|
|
- $countent = FooterContent::where('list_title', $data['list_title'])->first();
|
|
|
- if(!empty($countent)){
|
|
|
- return Result::error("该列表标题已存在!");
|
|
|
- }
|
|
|
- }
|
|
|
unset($data['type']);
|
|
|
$result = FooterContent::insertGetId($data);
|
|
|
if(empty($result)){
|
|
@@ -225,13 +215,6 @@ class FooterService implements FooterServiceInterface
|
|
|
*/
|
|
|
public function upFooterContent(array $data): array
|
|
|
{
|
|
|
- if($data['type'] == 1){
|
|
|
- $list_title = FooterContent::all()->pluck('list_title')->toArray();
|
|
|
- // 检查修改后的数据是否与已有数据重复
|
|
|
- if (in_array($data['list_title'], $list_title)) {
|
|
|
- return Result::error("修改后的列表名称已存在!");
|
|
|
- }
|
|
|
- }
|
|
|
unset($data['type']);
|
|
|
$result = FooterContent::where('id', $data['id'])->update($data);
|
|
|
if(empty($result)){
|