|
@@ -10,6 +10,7 @@ use app\middleware\AuthMiddleware;
|
|
|
use app\model\saas\SaasGoods;
|
|
use app\model\saas\SaasGoods;
|
|
|
use app\model\saas\SaasGoodsSku;
|
|
use app\model\saas\SaasGoodsSku;
|
|
|
use app\model\saas\SaasOrder;
|
|
use app\model\saas\SaasOrder;
|
|
|
|
|
+use app\model\saas\SaasOrderItem;
|
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
|
use LinFly\Annotation\Attributes\Route\RequestMapping;
|
|
use LinFly\Annotation\Attributes\Route\RequestMapping;
|
|
@@ -31,8 +32,8 @@ class Solution extends Base
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
$data = $request->all();
|
|
$data = $request->all();
|
|
|
- echo getDateFull()."===扩展回调\n";
|
|
|
|
|
- print_r($data);
|
|
|
|
|
|
|
+// echo getDateFull()."===扩展回调\n";
|
|
|
|
|
+// print_r($data);
|
|
|
if (isset($data['operate_type'])) {
|
|
if (isset($data['operate_type'])) {
|
|
|
if ($data['status'] == "PASS") { // 创建商品回调
|
|
if ($data['status'] == "PASS") { // 创建商品回调
|
|
|
$goods = (new SaasGoods)->where("goods_id",$data['product_id'])->findOrEmpty();
|
|
$goods = (new SaasGoods)->where("goods_id",$data['product_id'])->findOrEmpty();
|
|
@@ -56,7 +57,7 @@ class Solution extends Base
|
|
|
case "pre_create_refund": // 退款回调
|
|
case "pre_create_refund": // 退款回调
|
|
|
$order = (new SaasOrder)->where("order_sn",$msgData['order_id'])->findOrEmpty();
|
|
$order = (new SaasOrder)->where("order_sn",$msgData['order_id'])->findOrEmpty();
|
|
|
if ($order->isEmpty()) return json(['err_no' => 0,"err_tips" => "success"]);
|
|
if ($order->isEmpty()) return json(['err_no' => 0,"err_tips" => "success"]);
|
|
|
- if ($order['status'] <> 1) return json(['err_no' => 0,"err_tips" => "success"]);
|
|
|
|
|
|
|
+ if (!in_array($order['status'],[1,6])) return json(['err_no' => 0,"err_tips" => "success"]);
|
|
|
$order->status = 4; // 退款中
|
|
$order->status = 4; // 退款中
|
|
|
$order->refund_msg = json_encode($msgData['refund_reason']);
|
|
$order->refund_msg = json_encode($msgData['refund_reason']);
|
|
|
$order->refund_apply = getDateFull();
|
|
$order->refund_apply = getDateFull();
|
|
@@ -106,6 +107,16 @@ class Solution extends Base
|
|
|
"mobile" => $msgData['phone_num']??'',
|
|
"mobile" => $msgData['phone_num']??'',
|
|
|
"pay_money" => $msgData['total_amount']??0,
|
|
"pay_money" => $msgData['total_amount']??0,
|
|
|
]);
|
|
]);
|
|
|
|
|
+ $itemData = [];
|
|
|
|
|
+ foreach ($msgData['item_order_info_list'] as $key=>$val) {
|
|
|
|
|
+ $itemData[$key] = [
|
|
|
|
|
+ "order_sn" => $msgData['order_id'],
|
|
|
|
|
+ "item_order_id" => $val['item_order_id']
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!empty($itemData)) {
|
|
|
|
|
+ (new SaasOrderItem)->insertAll($itemData);
|
|
|
|
|
+ }
|
|
|
return json(['err_no' => 0,"err_tips" => "success","data" => [
|
|
return json(['err_no' => 0,"err_tips" => "success","data" => [
|
|
|
"order_entry_schema" => [
|
|
"order_entry_schema" => [
|
|
|
"path" => "pages/order/detail",
|
|
"path" => "pages/order/detail",
|