__('Hidedata 0'), '1' => __('Hidedata 1')]; } public function getHidedataTextAttr($value, $data) { $value = $value ? $value : (isset($data['hidedata']) ? $data['hidedata'] : ''); $list = $this->getHidedataList(); return isset($list[$value]) ? $list[$value] : ''; } public static function lst($where) { $model = new self; $xwhere = null; $order = "id desc"; if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid']; if (isset($where['plan_id']) && $where['plan_id'] > 0) $xwhere['plan_id'] = $where['plan_id']; // if (isset($where['paid']) && $where['paid'] > -1) $xwhere['paid'] = $where['paid']; // if (isset($where['help_id']) && $where['help_id'] > -1) $xwhere['help_id'] = $where['help_id']; // if (isset($where['order']) && $where['order'] != '') $order = $where['order']; // if (isset($where['key']) && $where['key'] != '') $xwhere['name|contact|tel'] = ['like', "%{$where['key']}%"]; $data = $model->where($xwhere)->where('hidedata',0)->order($order)->page($where['page'], $where['limit'])->select(); $count = $model->where($xwhere)->count(); return compact('count', 'data'); } public static function read($where) { $model = new self; $xwhere = null; $order = "id desc"; if (isset($where['id']) && $where['id'] > 0) $xwhere['id'] = $where['id']; if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid']; $data = $model->where($xwhere)->order($order)->select(); // $count = $model->where($xwhere)->count(); return $data; } }