修复错误
This commit is contained in:
parent
0636147f98
commit
4aa75aaf3b
@ -31,6 +31,7 @@ use crmeb\services\QrcodeService;
|
||||
use FormBuilder\Factory\Elm;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
use think\facade\Route;
|
||||
|
||||
class CommunityRepository extends BaseRepository
|
||||
@ -699,7 +700,7 @@ class CommunityRepository extends BaseRepository
|
||||
if ($value) {
|
||||
$attrValue = ProductAttrValue::where('unique', $value['product_attr_unique'])->find();
|
||||
if($attrValue){
|
||||
if($attrValue['mer_id']){
|
||||
if($attrValue['mer_id']<=0){
|
||||
throw new ValidateException('商户id不能为0');
|
||||
}
|
||||
$insert[] = [
|
||||
@ -755,7 +756,7 @@ class CommunityRepository extends BaseRepository
|
||||
$cartRepo = app()->make(StoreCartRepository::class);
|
||||
$cartIds = [];
|
||||
foreach ($community['resale'] as $item) {
|
||||
if($item['mer_id']){
|
||||
if($item['mer_id']<=0){
|
||||
throw new ValidateException('商户id不能为0');
|
||||
}
|
||||
$data = [
|
||||
@ -778,7 +779,8 @@ class CommunityRepository extends BaseRepository
|
||||
return $cartIds;
|
||||
} catch (\Exception $exception) {
|
||||
StoreCart::rollback();
|
||||
throw new ValidateException('下单出错');
|
||||
Log::error('加入购物车出错' . $exception->getMessage().'line'.$exception->getLine());
|
||||
throw new ValidateException( $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -807,7 +809,7 @@ class CommunityRepository extends BaseRepository
|
||||
$cartRepo = app()->make(StoreCartRepository::class);
|
||||
$cartIds = [];
|
||||
foreach ($community['entrust'] as $item) {
|
||||
if($item['mer_id']){
|
||||
if($item['mer_id']<=0){
|
||||
throw new ValidateException('商户id不能为0');
|
||||
}
|
||||
$data = [
|
||||
@ -830,6 +832,7 @@ class CommunityRepository extends BaseRepository
|
||||
return $cartIds;
|
||||
} catch (\Exception $exception) {
|
||||
StoreCart::rollback();
|
||||
Log::error('加入购物车出错' . $exception->getMessage().'line'.$exception->getLine());
|
||||
throw new ValidateException('下单出错');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user