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('支付成功'); } }