title = '列表'; $query = $this->_query($this->table); $this->type_arr = \app\common\model\BillType::getType(); $where= []; $were[] = ['i.is_deleted','=',0]; if($this->request->request('user_name')) $where[]= ['m.name','like','%'.$this->request->request('user_name').'%']; if($this->request->request('title')) $where[]= ['i.title','like','%'.$this->request->request('title').'%']; if($this->request->request('type')) $where[]= ['i.type','=',$this->request->request('type')]; $query->alias('i')->field('i.* ,b.title type_name,m.headimg,m.name as user_name,m.phone') ->join('store_member m',' m.id = i.user_id ','LEFT') ->join('bill_type b',' b.id = i.type ','LEFT'); if(!empty($where)) $query->where($where); $query ->order('i.id desc')->page(); } /** * 删除 * @auth true * @menu true * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function remove() { $this->_save($this->table, ['is_deleted' => '1']); } /** * 编辑 * @auth true * @menu true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function edit() { $this->title = '编辑'; $this->_form($this->table, 'form'); } }