|
|
|
@ -54,8 +54,9 @@ class Server extends Controller |
|
|
|
|
if ($category_id) { |
|
|
|
|
$where[] = ['server.category_id', '=', $category_id]; |
|
|
|
|
} |
|
|
|
|
$model = new \app\api\model\Server($where); |
|
|
|
|
$list = $model->getList(); |
|
|
|
|
$where[] = ['server.status', '=', 1]; |
|
|
|
|
$model = new \app\api\model\Server(); |
|
|
|
|
$list = $model->getList($where); |
|
|
|
|
$data['list'] = $list->items(); |
|
|
|
|
$data['total'] = $list->total(); |
|
|
|
|
if (!$list->isEmpty()) { |
|
|
|
@ -84,7 +85,7 @@ class Server extends Controller |
|
|
|
|
* @throws BaseException |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function userOrderList(): Json |
|
|
|
|
public function orderList(): Json |
|
|
|
|
{ |
|
|
|
|
$order_no = $this->request->post('order_no'); |
|
|
|
|
$order_status = intval($this->request->post('order_status')); |
|
|
|
@ -146,7 +147,7 @@ class Server extends Controller |
|
|
|
|
{ |
|
|
|
|
$serverId = intval($this->request->post('server_id')); |
|
|
|
|
$couponId = intval($this->request->post('coupon_id')); |
|
|
|
|
$remake = $this->request->post('remake'); |
|
|
|
|
$remake = (string)$this->request->post('remake'); |
|
|
|
|
if (!$serverId) { |
|
|
|
|
return $this->renderError('非法请求'); |
|
|
|
|
} |
|
|
|
@ -273,9 +274,6 @@ class Server extends Controller |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:交易查询 |
|
|
|
|
* @param string $outTradeNo |
|
|
|
|
* @param string $method |
|
|
|
|
* @param string $client |
|
|
|
|
* @return Json |
|
|
|
|
* @throws BaseException |
|
|
|
|
* @throws DataNotFoundException |
|
|
|
@ -283,10 +281,22 @@ class Server extends Controller |
|
|
|
|
* @throws ModelNotFoundException |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function tradeQuery(string $outTradeNo, string $method, string $client): Json |
|
|
|
|
public function tradeQuery(): Json |
|
|
|
|
{ |
|
|
|
|
$method = $this->request->post('method'); |
|
|
|
|
if (!$method) { |
|
|
|
|
return $this->renderError('支付方式不能为空'); |
|
|
|
|
} |
|
|
|
|
$order_no = $this->request->post('order_no'); |
|
|
|
|
if (!$order_no) { |
|
|
|
|
return $this->renderError('订单号不能为空'); |
|
|
|
|
} |
|
|
|
|
$client = $this->request->post('client'); |
|
|
|
|
if (!$client) { |
|
|
|
|
return $this->renderError('客户端不能为空'); |
|
|
|
|
} |
|
|
|
|
$paymentService = new ServerPayment; |
|
|
|
|
$result = $paymentService->setMethod($method)->setClient($client)->tradeQuery($outTradeNo); |
|
|
|
|
$result = $paymentService->setMethod($method)->setClient($client)->tradeQuery($order_no); |
|
|
|
|
$message = $result ? '恭喜您,订单已付款成功' : ($paymentService->getError() ?: '很抱歉,订单未支付,请重新发起'); |
|
|
|
|
return $this->renderSuccess(['isPay' => $result], $message); |
|
|
|
|
} |
|
|
|
|