pull/1/head
wanghousheng 12 months ago
parent ed0061b649
commit ede2b404ed
  1. 19
      app/api/controller/Server.php
  2. 14
      app/common/service/server/Order.php

@ -93,10 +93,24 @@ class Server extends Controller
$order_status = intval($this->request->post('order_status'));
$where = [];
if (!empty($order_no)) {
$where['order_no'] = $order_no;
$where[] = ['order_no', '=', $order_no];
}
if ($order_status) {
$where['order_status'] = $order_status;
$where[] = ['order_status', '=', $order_status];
}
$pay_method = $this->request->post('pay_method');
if (!empty($pay_method)) {
$where[] = ['pay_method', '=', $pay_method];
}
$start_time = $this->request->post('start_time');
if (!empty($start_time) && strtotime($start_time)) {
$start_time = strtotime($start_time);
$where[] = ['create_time', '>=', strtotime($start_time)];
}
$end_time = $this->request->post('end_time');
if (!empty($end_time) && strtotime($end_time)) {
$end_time = strtotime($end_time) + 86400;
$where[] = ['create_time', '<', $end_time];
}
$model = new ServerOrder($where);
$list = $model->orderList($where);
@ -107,6 +121,7 @@ class Server extends Controller
$data['list'][$key]['is_cancel'] = ServerServiceOrder::checkCancel($value);
$data['list'][$key]['is_dispatch'] = ServerServiceOrder::checkDispatch($value);
$data['list'][$key]['is_pay'] = ServerServiceOrder::checkPay($value);
$data['list'][$key]['is_success'] = ServerServiceOrder::checkSuccess($value);
unset($data['list'][$key]['image']);
if (!empty($data['list'][$key]['dealer'])) {
unset($data['list'][$key]['dealer']);

@ -116,6 +116,20 @@ class Order extends BaseService
return false;
}
/**
* @notes:是否可以完成
* @param $order
* @return bool
* @author: wanghousheng
*/
public static function checkSuccess($order): bool
{
if (!empty($order) && $order['order_status'] == ServerEnum::APPLYSERVER) {
return true;
}
return false;
}
/**
* @notes:是否可以支付
* @param $order

Loading…
Cancel
Save