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; }