suyuan/app/adminapi/logic/decorate/DecoratePageLogic.php

67 lines
1.8 KiB
PHP
Raw Normal View History

2023-10-14 13:36:39 +08:00
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\logic\decorate;
use app\common\logic\BaseLogic;
use app\common\model\decorate\DecoratePage;
/**
* 装修页面
* Class DecoratePageLogic
* @package app\adminapi\logic\theme
*/
class DecoratePageLogic extends BaseLogic
{
/**
* @notes 获取详情
* @param $id
* @return array
* @author 段誉
* @date 2022/9/14 18:41
*/
public static function getDetail($id)
{
return DecoratePage::findOrEmpty($id)->toArray();
}
/**
* @notes 保存装修配置
* @param $params
* @return bool
* @author 段誉
* @date 2022/9/15 9:37
*/
public static function save($params)
{
$pageData = DecoratePage::where(['id' => $params['id']])->findOrEmpty();
if ($pageData->isEmpty()) {
self::$error = '信息不存在';
return false;
}
DecoratePage::update([
'id' => $params['id'],
'type' => $params['type'],
'data' => $params['data'],
]);
return true;
}
}