repository = $repository; $this->agentRepository = $agentRepository; } /** * Common: 获取缴费列表 * Author: wu-hui * Time: 2024/06/17 14:25 * @return mixed */ public function paymentList(){ $config = $this->agentRepository->getConfig(); $paymentList = $config['payment_list'] ?? []; return app('json')->success($paymentList); } /** * Common: 生成缴费记录及订单 * Author: wu-hui * Time: 2024/06/17 18:12 * @return mixed */ public function createOrder(){ // 参数获取 $params = $this->request->params([ ['agent_id', 0], ['money', 0], ['title_quota', 0], ['other_quota', 0], // 支付相关 'pay_type', 'return_url' ]); // 参数判断 if($params['agent_id'] <= 0) throw new ValidateException('身份信息不明确,请重新登录!'); $params['uid'] = $this->request->uid(); $params['user_info'] = $this->request->userInfo(); $params['is_app'] = $this->request->isApp(); $res = $this->repository->createOrder($params); if($res) return $res; else return app('json')->success("操作成功"); } // 缴费记录获取 public function paymentRecord(){} /** * Common: 获取相关商户 * Author: wu-hui * Time: 2024/06/18 9:47 * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function merList(){ // 参数处理 [$page,$limit] = $this->getPage(); $params = $this->request->params([ ['agent_id',0], ['search_text',''], ]); // 信息列表获取 $data = $this->repository->getMerList((array)$params,(int)$page,(int)$limit); return app('json')->success($data); } }