From cb15bc29c9f9e608e2227b08af1cb3c99b5fe180 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 18 Feb 2022 09:24:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=B5=84=E9=87=91?= =?UTF-8?q?=E6=B5=81=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/statistic/FlowStatistic.php | 74 +++++++++++++++++++ .../order/StoreOrderSplitServices.php | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php diff --git a/crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php b/crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php new file mode 100644 index 000000000..549628693 --- /dev/null +++ b/crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php @@ -0,0 +1,74 @@ + +// +---------------------------------------------------------------------- + +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); + } +} diff --git a/crmeb/app/services/order/StoreOrderSplitServices.php b/crmeb/app/services/order/StoreOrderSplitServices.php index 3c4413fac..d27f2082e 100644 --- a/crmeb/app/services/order/StoreOrderSplitServices.php +++ b/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], '*');