| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\api\logic;
- use app\common\model\home_service\HomeSpecial;
- use app\common\logic\BaseLogic;
- use think\facade\Db;
- /**
- * HomeSpecial逻辑
- * Class HomeSpecialLogic
- * @package app\api\logic\home_service
- */
- class HomeSpecialLogic extends BaseLogic
- {
- /**
- * @param array $where
- * @param int $limit
- * @return array
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public static function getLists(array $where, int $limit=6)
- {
- return HomeSpecial::where($where)
- ->field('id,cover_type,cover,title,vue_web,vue_param')
- ->order('weight desc')
- ->limit($limit)
- ->select()
- ->toArray();
- }
- /**
- * @notes 获取详情
- * @param $params
- * @return array
- * @author likeadmin
- * @date 2024/11/18 10:05
- */
- public static function detail($params): array
- {
- return HomeSpecial::field('cover_type,cover,title,describe,content')->findOrEmpty($params['id'])->toArray();
- }
- }
|