diff --git a/app/common/model/store/product/Spu.php b/app/common/model/store/product/Spu.php index f2df5a5f..581bdffc 100644 --- a/app/common/model/store/product/Spu.php +++ b/app/common/model/store/product/Spu.php @@ -15,6 +15,7 @@ namespace app\common\model\store\product; use app\common\model\BaseModel; use app\common\model\store\coupon\StoreCouponProduct; +use app\common\model\store\StoreCategory; use app\common\model\store\StoreSeckillActive; use app\common\model\system\merchant\Merchant; use app\common\model\system\supplychain\SupplyChainLinkMerchant; @@ -190,6 +191,11 @@ class Spu extends BaseModel })->field('A.product_id,B.*')->where('status', 1)->where('type', 1)->where('send_type', 0)->where('is_del', 0) ->order('sort DESC,coupon_id DESC')->hidden(['is_del', 'status']); } + + public function cateName(){ + return $this->hasOne(StoreCategory::class,'store_category_id','cate_id')->bind(['cate_name']); + + } public function merCateId() { return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id'); diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 643342ba..74218251 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1134,7 +1134,7 @@ class StoreOrderRepository extends BaseRepository 'order_id' => $id, ]; $ret = $this->dao->getWhere($where); - if ($ret['is_virtual']<98 && $ret['is_virtual']!=0) throw new ValidateException('虚拟商品只能虚拟发货'); + if ($ret['is_virtual']!=0 && $ret['is_virtual']<98 ) throw new ValidateException('虚拟商品只能虚拟发货'); $cargo = ''; $count = 0; foreach ($ret->orderProduct as $item) { @@ -1313,7 +1313,7 @@ class StoreOrderRepository extends BaseRepository { $data['status'] = 1; $order = $this->dao->get($id); - if ($order['is_virtual'] && $data['delivery_type'] != 3) + if ($order['is_virtual'] && $data['delivery_type'] != 3 && $order['is_virtual'] <98) throw new ValidateException('虚拟商品只能虚拟发货'); $statusRepository = app()->make(StoreOrderStatusRepository::class); switch ($data['delivery_type']) { diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 2d60596a..a0db5004 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -33,7 +33,7 @@ class SpuRepository extends BaseRepository { public $dao; public $merchantFiled = 'mer_id,mer_name,mer_avatar,is_trader,mer_info,mer_keyword,type_id'; - public $productFiled = 'S.product_id,S.store_name,S.image,activity_id,S.keyword,S.price,S.mer_id,spu_id,S.status,store_info,brand_id,cate_id,unit_name,S.star,S.rank,S.sort,sales,S.product_type,rate,reply_count,extension_type,S.sys_labels,S.mer_labels,P.delivery_way,P.delivery_free,P.ot_price,svip_price_type,stock,mer_svip_status'; + public $productFiled = 'P.bar_code,S.product_id,S.store_name,S.image,activity_id,S.keyword,S.price,S.mer_id,spu_id,S.status,store_info,brand_id,cate_id,unit_name,S.star,S.rank,S.sort,sales,S.product_type,rate,reply_count,extension_type,S.sys_labels,S.mer_labels,P.delivery_way,P.delivery_free,P.ot_price,svip_price_type,stock,mer_svip_status'; public function __construct(SpuDao $dao) { $this->dao = $dao; @@ -153,7 +153,8 @@ class SpuRepository extends BaseRepository 'merchant' => function ($query) { $query->field($this->merchantFiled)->with(['type_name']); }, - 'issetCoupon' + 'issetCoupon', + 'cateName' ]); // 假如是小组服务采购商品,则增加供应链商品的筛选,只获取已入驻商户的商品 diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index a6d68864..553f22ec 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -46,9 +46,5 @@ class StoreMicro extends BaseController Db::rollback(); return app('json')->fail($e->getMessage()); } - Db::transaction(function () use ($mer_id,$product_id,$data) { - - }); - } } \ No newline at end of file