浏览代码

fix 修复退款报错,修复资金流水

evoxwht 3 年之前
父节点
当前提交
cb15bc29c9

+ 74 - 0
crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php

@@ -0,0 +1,74 @@
+<?php
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+namespace app\adminapi\controller\v1\statistic;
+
+use app\adminapi\controller\AuthController;
+use app\services\statistic\CapitalFlowServices;
+use think\facade\App;
+
+class FlowStatistic extends AuthController
+{
+    /**
+     * @param App $app
+     * @param CapitalFlowServices $services
+     */
+    public function __construct(App $app, CapitalFlowServices $services)
+    {
+        parent::__construct($app);
+        $this->services = $services;
+    }
+
+    /**
+     * 资金流水
+     * @return mixed
+     */
+    public function getFlowList()
+    {
+        $where = $this->request->getMore([
+            ['time', ''],
+            ['trading_type', 0],
+            ['keywords', ''],
+            ['ids', ''],
+            ['export', 0]
+        ]);
+        $date = $this->services->getFlowList($where);
+        return app('json')->success($date);
+    }
+
+    /**
+     * 资金流水备注
+     * @param $id
+     * @return mixed
+     */
+    public function setMark($id)
+    {
+        $data = $this->request->postMore([
+            ['mark', '']
+        ]);
+        $this->services->setMark($id, $data);
+        return app('json')->success('备注成功!');
+    }
+
+    /**
+     * 账单记录
+     * @return mixed
+     */
+    public function getFlowRecord()
+    {
+        $where = $this->request->getMore([
+            ['type', 'day'],
+            ['time', '']
+        ]);
+        $data = $this->services->getFlowRecord($where);
+        return app('json')->success($data);
+    }
+}

+ 1 - 1
crmeb/app/services/order/StoreOrderSplitServices.php

@@ -82,7 +82,7 @@ class StoreOrderSplitServices extends BaseServices
             $other_cart_ids[] = $other;
         }
         $cart_ids_arr = ['new' => $cart_ids, 'other' => $other_cart_ids];
-        if (empty($cart_ids_arr['other'])) return $old_order;
+        if (empty($cart_ids_arr['other'])) return [$old_order, ['id' => 0]];
         return $this->transaction(function () use ($id, $cart_ids_arr, $orderInfo, $orderInfoOld, $cartInfo, $storeOrderCreateServices, $storeOrderCartInfoServices, $statusService) {
             $order = $otherOrder = [];
             $statusData = $statusService->getColumn(['oid' => $id], '*');