取消售后
This commit is contained in:
parent
2c93ecba28
commit
06bdfacbe5
@ -7,8 +7,10 @@ use app\api\controller\BaseApiController;
|
|||||||
use app\api\lists\order\OrderList;
|
use app\api\lists\order\OrderList;
|
||||||
use app\api\validate\OrderValidate;
|
use app\api\validate\OrderValidate;
|
||||||
use app\common\enum\PayEnum;
|
use app\common\enum\PayEnum;
|
||||||
|
use app\common\enum\YesNoEnum;
|
||||||
use app\common\logic\PaymentLogic;
|
use app\common\logic\PaymentLogic;
|
||||||
use app\common\logic\PayNotifyLogic;
|
use app\common\logic\PayNotifyLogic;
|
||||||
|
use app\common\model\dict\DictData;
|
||||||
use app\common\model\store_order\StoreOrder;
|
use app\common\model\store_order\StoreOrder;
|
||||||
use app\common\model\system_store\SystemStoreStaff;
|
use app\common\model\system_store\SystemStoreStaff;
|
||||||
use app\common\model\user\UserAddress;
|
use app\common\model\user\UserAddress;
|
||||||
@ -18,6 +20,7 @@ use hg\apidoc\annotation as ApiDoc;
|
|||||||
#[ApiDoc\title('订单')]
|
#[ApiDoc\title('订单')]
|
||||||
class OrderController extends BaseApiController
|
class OrderController extends BaseApiController
|
||||||
{
|
{
|
||||||
|
public $notNeedLogin = ['refund_reason'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单列表
|
* 订单列表
|
||||||
@ -350,6 +353,15 @@ class OrderController extends BaseApiController
|
|||||||
return $this->fail('支付失败');
|
return $this->fail('支付失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[
|
||||||
|
ApiDoc\Title('订单详情'),
|
||||||
|
ApiDoc\url('/api/order/order/detail'),
|
||||||
|
ApiDoc\Method('GET'),
|
||||||
|
ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
|
||||||
|
ApiDoc\NotHeaders(),
|
||||||
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||||
|
]
|
||||||
public function detail()
|
public function detail()
|
||||||
{
|
{
|
||||||
$order_id = (int)$this->request->get('order_id');
|
$order_id = (int)$this->request->get('order_id');
|
||||||
@ -497,6 +509,46 @@ class OrderController extends BaseApiController
|
|||||||
return $this->success('申请成功');
|
return $this->success('申请成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[
|
||||||
|
ApiDoc\Title('订单退款原因'),
|
||||||
|
ApiDoc\url('/api/order/order/refund_reason'),
|
||||||
|
ApiDoc\Method('GET'),
|
||||||
|
ApiDoc\Param(),
|
||||||
|
ApiDoc\NotHeaders(),
|
||||||
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||||
|
]
|
||||||
|
public function refund_reason()
|
||||||
|
{
|
||||||
|
return DictData::where('type_value','reason')->where('status',YesNoEnum::YES)
|
||||||
|
->select()->toArray();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[
|
||||||
|
ApiDoc\Title('取消售后'),
|
||||||
|
ApiDoc\url('/api/order/order/cancel_sale'),
|
||||||
|
ApiDoc\Method('GET'),
|
||||||
|
ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
|
||||||
|
ApiDoc\NotHeaders(),
|
||||||
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||||
|
]
|
||||||
|
public function cancel_sale()
|
||||||
|
{
|
||||||
|
$order_id = (int)$this->request->get('order_id');
|
||||||
|
$where = [
|
||||||
|
'id' => $order_id,
|
||||||
|
'uid' => $this->userId,
|
||||||
|
];
|
||||||
|
$order = OrderLogic::cancelSell($where);
|
||||||
|
if ($order) {
|
||||||
|
return $this->success();
|
||||||
|
} else {
|
||||||
|
return $this->fail('取消失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -445,6 +445,19 @@ class OrderLogic extends BaseLogic
|
|||||||
return $find;
|
return $find;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//取消售后
|
||||||
|
public static function cancelSell($where)
|
||||||
|
{
|
||||||
|
return StoreOrder::where($where)->update(
|
||||||
|
[
|
||||||
|
'refund_status'=>OrderEnum::CANCEL_SALE,
|
||||||
|
'status'=>OrderEnum::CANCEL_ORDER,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//核销
|
//核销
|
||||||
|
|
||||||
|
@ -95,9 +95,19 @@ class OrderEnum
|
|||||||
const SUPPLIER = 3;
|
const SUPPLIER = 3;
|
||||||
const SYSTEM = 4;
|
const SYSTEM = 4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
* @CANCEL_ORDER 取消售后
|
||||||
|
*/
|
||||||
|
const CANCEL_ORDER = 5;
|
||||||
|
|
||||||
|
//退款状态
|
||||||
const REFUND_STATUS_NO = 0;
|
const REFUND_STATUS_NO = 0;
|
||||||
const REFUND_STATUS_YES = 1;
|
const REFUND_STATUS_YES = 1;
|
||||||
const REFUND_STATUS_FINISH = 2;
|
const REFUND_STATUS_FINISH = 2;
|
||||||
|
const CANCEL_SALE = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取支付类型
|
* @notes 获取支付类型
|
||||||
|
Loading…
x
Reference in New Issue
Block a user