MetInfo帮助中心
网站首页
新手建站
米拓流程
使用手册
常见问题
模板制作教程
商业模板修改教程
应用开发教程
应用代码规范
[TOC] #### 继承app类 ``` //admin/index.class.php defined('IN_MET') or exit('No permission'); load::sys_class('app'); class index extends app { public function __construct() { global $_M; parent::__construct(); } public function doindex() { global $_M; $this->show('app/index'); } } ``` #### 应用后台加载模板使用show方法 ``` public function doindex() { global $_M; $this->show('app/index'); } ``` #### 查询单条记录 ``` $this->table('applist')->where("no = 10043")->find(); ``` #### 查询多条记录 ``` $this->table('applist')->where("no = 10043")->get(); ``` #### 查询指定字段 ``` $this->table('applist')->where("no = 10043")->get('no,appname'); ``` #### 限制查询条数 ``` $this->table('applist')->limit(10)->get(); $this->table('applist')->limit(0,10)->get(); ``` #### 插入数据 ``` $data = array(); $data['no'] = 10043; $data['appname']='商城模块'; $this->table('applist')->insert($data); ``` #### 更新数据 ``` $data = array(); $data['appname'] = '商城模块4.0'; $this->table('applist')->where('no = 10043')->update($data); ``` #### 删除数据 ``` $this->table('applist')->where('no = 10043')->delete(); ```