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