123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Storesnscomment extends BaseModel
- {
- public $page_info;
-
- public function getStoresnscommentList($condition, $field = '*', $order = 'storesnscomm_id desc', $limit = 0, $pagesize = 0)
- {
- if ($pagesize) {
- $res = Db::name('storesnscomment')->where($condition)->field($field)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
- $this->page_info = $res;
- return $res->items();
- } else {
- return Db::name('storesnscomment')->where($condition)->field($field)->order($order)->select()->toArray();
- }
- }
-
- public function getStoresnscommentCount($condition)
- {
- return Db::name('storesnscomment')->where($condition)->count();
- }
-
- public function getStoresnscommentInfo($condition, $field = '*')
- {
- return Db::name('storesnscomment')->where($condition)->field($field)->find();
- }
-
- public function addStoresnscomment($data)
- {
- return Db::name('storesnscomment')->insertGetId($data);
- }
-
- public function editStoresnscomment($update, $condition)
- {
- return Db::name('storesnscomment')->where($condition)->update($update);
- }
-
- public function delStoresnscomment($condition)
- {
- return Db::name('storesnscomment')->where($condition)->delete();
- }
- }
|