12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- /**
- * Created by PhpStorm.
- * User: sicilon_IT
- * Date: 2021/10/7
- * Time: 22:55
- */
- namespace app\index\model;
- use think\Model;
- class groupusermodel extends Model
- {
- protected $table = 't_groupuser';
- /*
- * 20211007
- */
- public function insinfo($arr)
- {
- $this->setAttr('id', null)->isUpdate(false)->allowField(true)->save($arr);
- return $this->id;
- }
- public function getinfo($where)
- {
- $info = $this->where($where)->find();
- return $info;
- }
- /***
- * 获取列表数据
- * 20211012
- * wj
- */
- public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false)
- {
- $sqlObj = $this->where($where);
- if ("count" != $field) {
- $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size);
- if ($row) {
- $data = $sqlObj->find();
- } else {
- $data = $sqlObj->select();
- }
- } else {
- $data = $sqlObj = $sqlObj->count();
- }
- return $data;
- }
- public function updateinfo($where, $updateData)
- {
- $row = $this->where($where)->update($updateData);
- return empty($row) ? false : $row;
- }
- }
|