dataLists(new UserRechargeLists()); } /** * @notes 添加充值记录 * @return \think\response\Json * @author admin * @date 2024/06/06 14:29 */ public function add() { $params = (new UserRechargeValidate())->post()->goCheck('add'); $result = UserRechargeLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(UserRechargeLogic::getError()); } /** * @notes 编辑充值记录 * @return \think\response\Json * @author admin * @date 2024/06/06 14:29 */ public function edit() { $params = (new UserRechargeValidate())->post()->goCheck('edit'); $result = UserRechargeLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(UserRechargeLogic::getError()); } /** * @notes 删除充值记录 * @return \think\response\Json * @author admin * @date 2024/06/06 14:29 */ public function delete() { $params = (new UserRechargeValidate())->post()->goCheck('delete'); UserRechargeLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取充值记录详情 * @return \think\response\Json * @author admin * @date 2024/06/06 14:29 */ public function detail() { $params = (new UserRechargeValidate())->goCheck('detail'); $result = UserRechargeLogic::detail($params); return $this->data($result); } public function refund() { $params = (new UserRechargeValidate())->post()->goCheck('refund'); $detail = UserRecharge::where('id',$params['id'])->findOrEmpty(); if(empty($detail)){ return $this->fail('无该充值订单请检查'); } //现金 if($detail['recharge_type'] =='CASH_PAY'){ PayNotifyLogic::recharge_cash_refund($params['id']); return $this->success(); } //微信 if($detail['recharge_type'] == 'INDUSTRYMEMBERS'){ $money = (int)bcmul($detail['price'],100); (new \app\common\logic\store_order\StoreOrderLogic()) ->refund($detail['order_id'],$money,$money); return $this->success(); } //支付宝 if($detail['recharge_type'] == 'ALI_INDUSTRYMEMBERS'){ } return $this->success(); } }