first commit
This commit is contained in:
95
app/adminapi/lists/decorate/DecorateHintLists.php
Normal file
95
app/adminapi/lists/decorate/DecorateHintLists.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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\lists\decorate;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\decorate\DecorateHint;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\service\FileService;
|
||||
|
||||
/**
|
||||
* 提示内容列表
|
||||
* Class DecorateHintLists
|
||||
* @package app\adminapi\listsdecorate
|
||||
*/
|
||||
class DecorateHintLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author BD
|
||||
* @date 2024/03/17 17:01
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取提示内容列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/03/17 17:01
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$items = DecorateHint::where($this->searchWhere)
|
||||
->field(['id', 'cid', 'title', 'text', 'content', 'is_show', 'sort', 'image', 'contract_y_logo', 'contract_b_logo', 'langs', 'create_time'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['sort' => 'desc','cid' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($items as &$item) {
|
||||
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||
foreach ($item['langs'] as &$content_lang) {
|
||||
if(isset($content_lang['image'])){
|
||||
$content_lang['image'] = FileService::getFileUrl($content_lang['image']);
|
||||
}
|
||||
|
||||
$content_lang['content'] = get_file_domain($content_lang['content']);
|
||||
}
|
||||
|
||||
if($item['id'] == 23){
|
||||
$item['contract_y_logo'] = FileService::getFileUrl($item['contract_y_logo']);
|
||||
$item['contract_b_logo'] = FileService::getFileUrl($item['contract_b_logo']);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取提示内容数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/03/17 17:01
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return DecorateHint::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
83
app/adminapi/lists/decorate/DecorateNavLists.php
Normal file
83
app/adminapi/lists/decorate/DecorateNavLists.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?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\lists\decorate;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\decorate\DecorateNav;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 菜单按钮列表
|
||||
* Class DecorateNavLists
|
||||
* @package app\adminapi\listsdecorate
|
||||
*/
|
||||
class DecorateNavLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author BD
|
||||
* @date 2024/03/17 16:41
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取菜单按钮列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/03/17 16:41
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$items = DecorateNav::where($this->searchWhere)
|
||||
->field(['id', 'name', 'image', 'image_ext', 'link', 'loca', 'is_show', 'sort', 'langs'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['sort' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($items as &$item) {
|
||||
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取菜单按钮数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/03/17 16:41
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return DecorateNav::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
88
app/adminapi/lists/decorate/DecorateSwiperLists.php
Normal file
88
app/adminapi/lists/decorate/DecorateSwiperLists.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?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\lists\decorate;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\decorate\DecorateSwiper;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\service\FileService;
|
||||
|
||||
|
||||
/**
|
||||
* 轮播图列表
|
||||
* Class DecorateSwiperLists
|
||||
* @package app\adminapi\lists\decorate
|
||||
*/
|
||||
class DecorateSwiperLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author BD
|
||||
* @date 2024/03/16 17:34
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取轮播图列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/03/16 17:34
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$DecorateSwipers = DecorateSwiper::where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['sort' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($DecorateSwipers as &$item) {
|
||||
$item['langs'] = json_decode($item['langs'], JSON_UNESCAPED_UNICODE);
|
||||
|
||||
foreach ($item['langs'] as &$content_lang) {
|
||||
$content_lang['image'] = FileService::getFileUrl($content_lang['image']);
|
||||
// if(!isset($content_lang['image_ext'])) $content_lang['image_ext'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return $DecorateSwipers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取轮播图数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/03/16 17:34
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return DecorateSwiper::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user