insertGetId($data); return empty($id) ? false : $id; } public function getInfo($where, $field = "*", $row = true) { $info = $this->field($field)->where($where); if ($row) { $info = $info->find(); } else { $info = $info->select(); } return empty($info) ? false : $info; } public function updateinfo($where, $updateData) { $row = $this->where($where)->update($updateData); return empty($row) ? false : $row; } public function deleteinfo($where) { $row = $this->where($where)->delete(); return empty($row) ? false : $row; } public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false) { $whereUse = []; if (isset($where['company']) && !empty($where['company'])) { $whereUse['company'] = ['like', "%" . $where['company'] . "%"]; } if (isset($where['wname']) && !empty($where['wname'])) { $whereUse['wname'] = ['like', "%" . $where['wname'] . "%"]; } if (isset($where['telno']) && !empty($where['telno'])) { $whereUse['telno'] = ['like', "%" . $where['telno'] . "%"]; } if (isset($where['isactive']) && in_array($where['isactive'], [0, 1])) { $whereUse['isactive'] = $where['isactive']; } if (isset($where['ispass']) && in_array($where['ispass'], [0, 1, 2])) { $whereUse['ispass'] = $where['ispass']; } if (isset($where['createtime']) && is_array($where['createtime'])) { $whereUse['createtime'] = ['between', $where['createtime']]; } $sqlObj = $this->where($whereUse); 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; } /** * 获取企业总量 * 20211228 * wj */ public function getcount() { $count = $this->where([])->count(); return $count; } /** * 获取分析数据 * 20211228 * wj */ public function statistics() { $sql = "select isactive,ispass,count(*) as count from " . $this->table . " group by isactive,ispass"; $list = $this->query("select * from (" . $sql . ") as t"); return $list; } }