dao = $dao; } /** * @param array $where * @param $page * @param $limit * @return array * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException * @author xaboy * @day 2020-05-07 */ public function getList(array $where, $page, $limit) { $query = $this->dao->search($where); $count = $query->count($this->dao->getPk()); $list = $query->page($page, $limit)->select(); return compact('count', 'list'); } /** * @param null $id * @param array $formData * @return Form * @throws FormBuilderException * @author xaboy * @day 2020-05-07 */ public function form($id = null, array $formData = []) { $action = Route::buildUrl('configIdentityUpdate' , compact('id'))->build(); return Elm::createForm($action, [ Elm::number('arrive_num_own', '个人达标贡献值')->min(0)->size('large'), Elm::number('arrive_num_team', '团队达标贡献值')->min(0)->size('large') ])->setTitle('业务员升级设置')->formData($formData); } /** * @param $id * @return Form * @throws FormBuilderException * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException * @author xaboy * @day 2020-05-07 */ public function updateForm($id) { return $this->form($id, $this->dao->get($id)->toArray()); } /** * @param array $where * @return array * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException */ public function getIdentityList(array $where = []) { $query = $this->dao->search($where); return $query->select()->toArray(); } }