12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- /**
-
- *
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 数据层模型
- */
- class Document extends BaseModel
- {
- /**
- * 查询所有系统文章
- * @access public
- * @author csdeshang
- * @return type
- */
- public function getDocumentList()
- {
- return Db::name('document')->select()->toArray();
- }
- /**
- * 根据编号查询一条
- * @access public
- * @author csdeshang
- * @param int $id 文章id
- * @return array
- */
- public function getOneDocumentById($id)
- {
- return Db::name('document')->where('document_id', $id)->find();
- }
- /**
- * 根据标识码查询一条
- * @access public
- * @author csdeshang
- * @param type $code 标识码
- * @return type
- */
- public function getOneDocumentByCode($code)
- {
- return Db::name('document')->where('document_code', $code)->find();
- }
- /**
- * 更新
- * @access public
- * @author csdeshang
- * @param array $data 更新数据
- * @return bool
- */
- public function editDocument($data)
- {
- return Db::name('document')->where('document_id', $data['document_id'])->update($data);
- }
- }
|