request->get(); $params['user_id'] = $this->userId; $result = RobotLogic::getIndexData($params); return $this->data($result); } /** * @notes 量化 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function buy() { $params = (new RobotValidate())->post()->goCheck('buy', [ 'user_id' => $this->userId, ]); $result = RobotLogic::buy($params); if (false === $result) { return $this->fail(RobotLogic::getError()); } return $this->data($result); } /** * @notes 抢单记录 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function recordLists() { return $this->dataLists(new LhRecordLists()); } /** * @notes 抢单 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function grab() { $params = $this->request->post(); $params['user_id'] = $this->userId; $result = RobotLogic::grab($params); if (false === $result) { return $this->fail(RobotLogic::getError()); } return $this->data($result); } /** * @notes 获取进行中订单 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author BD * @date 2024/02/22 10:54 */ public function grabIngRecord() { $result = RobotLogic::grabIngRecord([ 'user_id' => $this->userId ]); if (false === $result) { return $this->fail(RobotLogic::getError()); } return $this->data($result); } /** * @notes 订单支付 * @return \think\response\Json * @author BD * @date 2024/02/22 10:54 */ public function grabPay() { $params = (new RobotValidate())->post()->goCheck('grabPay', [ 'user_id' => $this->userId, ]); $result = RobotLogic::grabPay($params); if (false === $result) { return $this->fail(RobotLogic::getError()); } return $this->data($result); } }