123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Storemsg extends BaseModel
- {
- public $page_info;
-
- public function addStoremsg($data)
- {
- $data['storemsg_addtime'] = TIMESTAMP;
- $storemsg_id = Db::name('storemsg')->insertGetId($data);
- return $storemsg_id;
- }
-
- public function editStoremsg($condition, $update)
- {
- return Db::name('storemsg')->where($condition)->update($update);
- }
-
- public function getStoremsgInfo($condition, $field = '*')
- {
- return Db::name('storemsg')->field($field)->where($condition)->find();
- }
-
- public function getStoremsgList($condition, $field = '*', $pagesize = '0', $order = 'storemsg_id desc')
- {
- $return = Db::name('storemsg')->field($field)->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
- $this->page_info = $return;
- return $return->items();
- }
-
- public function getStoremsgCount($condition)
- {
- return Db::name('storemsg')->where($condition)->count();
- }
-
- public function delStoremsg($condition)
- {
- Db::name('storemsg')->where($condition)->delete();
- }
- }
|