From f2277960c22bccbddb026ad47d36e37e729fac47 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 23 May 2024 16:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=92=8C=E8=B4=AD=E8=B4=A7=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/operation/OpurchaseclassLogic.php | 17 ++--------------- .../financial/FinancialRecordController.php | 5 +++-- .../order/OpurchaseOrderController.php | 4 ++-- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/app/admin/logic/operation/OpurchaseclassLogic.php b/app/admin/logic/operation/OpurchaseclassLogic.php index 875fa03..562e05d 100644 --- a/app/admin/logic/operation/OpurchaseclassLogic.php +++ b/app/admin/logic/operation/OpurchaseclassLogic.php @@ -261,21 +261,8 @@ class OpurchaseclassLogic extends BaseLogic } $number=Opurchaseclass::where('id',$find['order_id'])->value('number'); $time=time(); - //平台支出 - $record[] = [ - 'financial_record_sn' => $time, - 'order_id' => $find['order_id'], - 'number_sn' => $number, - 'user_id' => 0, - 'financial_type' => OrderEnum::PLATFORM_ORDER_PAY, - 'financial_pm' => OrderEnum::EXPENDITURE, - 'number' => $price, - 'status' => 1, - 'type' => OrderEnum::USER, - 'mer_id' => getenv('OPERATED') - ]; //供应链获得流水 - $record[] = [ + $record = [ 'financial_record_sn' => $time, 'order_id' => $find['order_id'], 'number_sn' => $number, @@ -287,7 +274,7 @@ class OpurchaseclassLogic extends BaseLogic 'type' => OrderEnum::SUPPLIER, 'mer_id' => $find['supplier_id'], ]; - (new FinancialRecord())->saveAll($record); + FinancialRecord::create($record); } $res = $find->save(); if ($res) { diff --git a/app/api/controller/financial/FinancialRecordController.php b/app/api/controller/financial/FinancialRecordController.php index 45533b1..8279685 100644 --- a/app/api/controller/financial/FinancialRecordController.php +++ b/app/api/controller/financial/FinancialRecordController.php @@ -23,8 +23,9 @@ class FinancialRecordController extends BaseApiController { $start_time = $this->request->get('start_time'); $end_time = $this->request->get('end_time'); - if(!isset($start_time)||!isset($end_time)){ - return $this->fail('请选择时间'); + if(isset($start_time)||isset($end_time)){ + $start_time=date('Y-m-d',time()); + $end_time=date('Y-m-d',strtotime('-7 days')); } $start_time = strtotime($start_time); // 开始时间 $end_time = strtotime($end_time); // 结束时间 diff --git a/app/api/controller/order/OpurchaseOrderController.php b/app/api/controller/order/OpurchaseOrderController.php index 7d295c1..d6e8473 100644 --- a/app/api/controller/order/OpurchaseOrderController.php +++ b/app/api/controller/order/OpurchaseOrderController.php @@ -88,7 +88,7 @@ class OpurchaseOrderController extends BaseApiController } /** - * @notes 创建购货订单 + * @notes 商户创建购货订单 */ public function createOrder(){ $params=$this->request->post(); @@ -98,7 +98,7 @@ class OpurchaseOrderController extends BaseApiController }else{ PayNotifyLogic::handle('opurchaseclass', $order['number']); //推送队列 - Redis::send('push-supplier-products', ['order_id'=>$order['id']]); + // Redis::send('push-supplier-products', ['order_id'=>$order['id']]); return $this->success('支付成功'); } }