From d8a78633ea311325d24497de8e933d4670156c1d Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 29 May 2024 09:38:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin/controller,=20retail/CashierclassLog?= =?UTF-8?q?ic):=20=E4=BC=98=E5=8C=96=E9=87=87=E8=B4=AD=E7=B1=BB=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/operation/OpurchaseclassController.php | 8 ++++++++ app/admin/logic/retail/CashierclassLogic.php | 2 +- app/api/validate/OpurchaseGoodsOfferValidate.php | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/admin/controller/operation/OpurchaseclassController.php b/app/admin/controller/operation/OpurchaseclassController.php index 3cd72d8..38124ba 100644 --- a/app/admin/controller/operation/OpurchaseclassController.php +++ b/app/admin/controller/operation/OpurchaseclassController.php @@ -112,6 +112,14 @@ class OpurchaseclassController extends BaseAdminController 'is_adopt' => 1 ]; $item['nums_count'] = OpurchaseGoodsOffer::where($where)->sum('nums'); + $offer=OpurchaseGoodsOffer::where($where)->field('delivery_name,delivery_id')->find(); + if($offer){ + $item['delivery_name']=$offer['delivery_name']; + $item['delivery_id']=$offer['delivery_id']; + }else{ + $item['delivery_name']=''; + $item['delivery_id']=''; + } }); $data['count'] = Opurchaseinfo::where($where)->count(); $data['lists'] = $res?->toArray(); diff --git a/app/admin/logic/retail/CashierclassLogic.php b/app/admin/logic/retail/CashierclassLogic.php index 26b5024..0a52bc4 100644 --- a/app/admin/logic/retail/CashierclassLogic.php +++ b/app/admin/logic/retail/CashierclassLogic.php @@ -155,7 +155,7 @@ class CashierclassLogic extends BaseLogic ->with('goodsName') ->field('goods,price sell,nums')->select()->each(function($item){ $item['msg']='预计48小时发货'; - $item['goods_unit']=Unit::where('id',$item['unit'])->value('name'); + $item['unit_name']=Unit::where('id',$item['unit'])->value('name'); }); $merchant=Merchant::where('mer_id',$find['merchant'])->field('mer_id,uid,mer_name,service_phone,mer_address')->find(); $merchant['real_name']=User::where('id',$merchant['uid'])->value('real_name'); diff --git a/app/api/validate/OpurchaseGoodsOfferValidate.php b/app/api/validate/OpurchaseGoodsOfferValidate.php index c3ca615..3cb6923 100644 --- a/app/api/validate/OpurchaseGoodsOfferValidate.php +++ b/app/api/validate/OpurchaseGoodsOfferValidate.php @@ -42,6 +42,9 @@ if(!isset($v['nums']) || $v['nums'] == '') { return '第'.($k+1).'行缺少数量'; } + if($data['nums']<$v['nums']){ + return '第'.($k+1).'行数量不能大于采购数量'; + } } return true; }