12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Informsubject extends BaseModel
- {
- public $page_info;
-
- public function addInformsubject($data)
- {
- return Db::name('informsubject')->insertGetId($data);
- }
-
- public function editInformsubject($update_array, $where_array)
- {
- return Db::name('informsubject')->where($where_array)->update($update_array);
- }
-
- public function delInformsubject($condition)
- {
- return Db::name('informsubject')->where($condition)->delete();
- }
-
- public function getInformsubjectList($condition = '', $pagesize = '', $field = '', $order = 'informsubject_id asc')
- {
- if ($pagesize) {
- $res = Db::name('informsubject')->field($field)->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
- $this->page_info = $res;
- return $res->items();
- } else {
- return Db::name('informsubject')->field($field)->where($condition)->order($order)->select()->toArray();
- }
- }
-
- public function getOneInformsubject($condition)
- {
- return Db::name('informsubject')->where($condition)->find();
- }
- }
|