1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class MiniproLive extends BaseModel {
- public $page_info;
- public function getMiniproLiveList($condition, $field = '*', $pagesize=10, $order = 'minipro_live_id desc') {
- if ($pagesize) {
- $result = Db::name('minipro_live')->field($field)->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
- $this->page_info = $result;
- return $result->items();
- } else {
- $result = Db::name('minipro_live')->field($field)->where($condition)->order($order)->select()->toArray();
- return $result;
- }
- }
-
- public function getMiniproLiveInfo($condition) {
- $result = Db::name('minipro_live')->where($condition)->find();
- return $result;
- }
-
- public function addMiniproLive($data) {
- $result = Db::name('minipro_live')->insertGetId($data);
- return $result;
- }
-
- public function editMiniproLive($data, $condition) {
- $result = Db::name('minipro_live')->where($condition)->update($data);
- return $result;
- }
-
- public function delMiniproLive($condition) {
- return Db::name('minipro_live')->where($condition)->delete();
- }
- }
|