where($where) ->count(); $list = (new SystemBannerModel()) ->where($where) ->withAttr('img_pic', function ($val, $data) { return __HTTPGETIMGADMIN($val); }) ->page($page, $limit) ->order($sort) ->select(); return [$count, $list]; } public static function edit($post) { $row = new SystemBannerModel(); try { $post['banner_desc'] = htmlspecialchars_decode($post['banner_desc']); $post['img_pic'] = __HTTPSAVEIMGADMIN($post['img_pic']); $save = $row->save($post); RedisCache::clear('getAppBanner' . $row['type']); return $save; } catch (\Exception $e) { return '保存失败'; } } public static function add($data) { $data['img_pic'] = __HTTPSAVEIMGADMIN($data['img_pic']); $data['banner_desc'] = htmlspecialchars_decode($data['banner_desc']); $data['create_time'] = sr_getcurtime(time()); unset($data['file']); $save = (new SystemBannerModel())->insert($data); RedisCache::clear('getAppBanner' . $data['type']); return $save; } }