1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace huo\model\page;
- use huo\model\common\CommonModel;
- class WebpageModel extends CommonModel {
- protected $name = 'web_page';
- public function getPage($code = '') {
- if (empty($code)) {
- return [
- 'title' => '',
- 'content' => '',
- ];
- }
- $_map['code'] = $code;
- $_map['status'] = 2;
- $_info = $this->where($_map)->find()->toArray();
- if (!empty($_info)) {
- return $_info;
- }
- return [
- 'title' => '',
- 'content' => '',
- ];
- }
- public function getPages($codes = []) {
- if (empty($codes)) {
- return [
- ];
- }
- $_map['code'] = ['in',$codes];
- $_map['status'] = 2;
- $_pages = $this->where($_map)->select()->toArray();
- if (!empty($_pages)) {
- return $_pages;
- }
- return [
- ];
- }
- }
|