修复错误

This commit is contained in:
mkm 2023-04-18 11:55:50 +08:00
parent c676680e9a
commit 2ffc10a8e5
4 changed files with 11 additions and 8 deletions

View File

@ -15,6 +15,7 @@ namespace app\common\model\store\product;
use app\common\model\BaseModel; use app\common\model\BaseModel;
use app\common\model\store\coupon\StoreCouponProduct; use app\common\model\store\coupon\StoreCouponProduct;
use app\common\model\store\StoreCategory;
use app\common\model\store\StoreSeckillActive; use app\common\model\store\StoreSeckillActive;
use app\common\model\system\merchant\Merchant; use app\common\model\system\merchant\Merchant;
use app\common\model\system\supplychain\SupplyChainLinkMerchant; 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) })->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']); ->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() public function merCateId()
{ {
return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id'); return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id');

View File

@ -1134,7 +1134,7 @@ class StoreOrderRepository extends BaseRepository
'order_id' => $id, 'order_id' => $id,
]; ];
$ret = $this->dao->getWhere($where); $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 = ''; $cargo = '';
$count = 0; $count = 0;
foreach ($ret->orderProduct as $item) { foreach ($ret->orderProduct as $item) {
@ -1313,7 +1313,7 @@ class StoreOrderRepository extends BaseRepository
{ {
$data['status'] = 1; $data['status'] = 1;
$order = $this->dao->get($id); $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('虚拟商品只能虚拟发货'); throw new ValidateException('虚拟商品只能虚拟发货');
$statusRepository = app()->make(StoreOrderStatusRepository::class); $statusRepository = app()->make(StoreOrderStatusRepository::class);
switch ($data['delivery_type']) { switch ($data['delivery_type']) {

View File

@ -33,7 +33,7 @@ class SpuRepository extends BaseRepository
{ {
public $dao; public $dao;
public $merchantFiled = 'mer_id,mer_name,mer_avatar,is_trader,mer_info,mer_keyword,type_id'; 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) public function __construct(SpuDao $dao)
{ {
$this->dao = $dao; $this->dao = $dao;
@ -153,7 +153,8 @@ class SpuRepository extends BaseRepository
'merchant' => function ($query) { 'merchant' => function ($query) {
$query->field($this->merchantFiled)->with(['type_name']); $query->field($this->merchantFiled)->with(['type_name']);
}, },
'issetCoupon' 'issetCoupon',
'cateName'
]); ]);
// 假如是小组服务采购商品,则增加供应链商品的筛选,只获取已入驻商户的商品 // 假如是小组服务采购商品,则增加供应链商品的筛选,只获取已入驻商户的商品

View File

@ -46,9 +46,5 @@ class StoreMicro extends BaseController
Db::rollback(); Db::rollback();
return app('json')->fail($e->getMessage()); return app('json')->fail($e->getMessage());
} }
Db::transaction(function () use ($mer_id,$product_id,$data) {
});
} }
} }