Browse Source

错误提示修改

master
weigang 5 years ago
parent
commit
c1d1324424
  1. 12
      app/Constants/v3/ErrorCode.php
  2. 4
      app/Service/v3/Implementations/GoodsActivityService.php
  3. 4
      app/Service/v3/Implementations/GoodsService.php

12
app/Constants/v3/ErrorCode.php

@ -144,6 +144,12 @@ class ErrorCode extends AbstractConstants
*/ */
const STORE_NOT_AVAILABLE = 708; const STORE_NOT_AVAILABLE = 708;
/**
* 商户已休息
* @Message("当前商户已歇业")
*/
const STORE_REST = 709;
/************************************/ /************************************/
/* 定位相关 751-800 */ /* 定位相关 751-800 */
/************************************/ /************************************/
@ -242,6 +248,12 @@ class ErrorCode extends AbstractConstants
*/ */
const GOODS_ACTIVITY_CANNOT_USE_COUPON = 1156; const GOODS_ACTIVITY_CANNOT_USE_COUPON = 1156;
/**
* 活动商品不存在
* @Message("商品不存在")
*/
const GOODS_ACTIVITY_NOT_EXISTS = 1156;
/************************************/ /************************************/
/* 优惠券相关 1201-1250 */ /* 优惠券相关 1201-1250 */
/************************************/ /************************************/

4
app/Service/v3/Implementations/GoodsActivityService.php

@ -24,7 +24,7 @@ class GoodsActivityService implements GoodsActivityServiceInterface
{ {
if (empty($goods)) { if (empty($goods)) {
return ErrorCode::GOODS_ACTIVITY_ON_SALE_NO;
return ErrorCode::GOODS_ACTIVITY_NOT_EXISTS;
} }
// 活动是否已经结束 // 活动是否已经结束
@ -34,7 +34,7 @@ class GoodsActivityService implements GoodsActivityServiceInterface
// 商户歇业 // 商户歇业
if($goods->store->is_rest == 1){ if($goods->store->is_rest == 1){
return ErrorCode::GOODS_ACTIVITY_ON_SALE_NO;
return ErrorCode::STORE_REST;
} }
// 商品下架或已删除 // 商品下架或已删除

4
app/Service/v3/Implementations/GoodsService.php

@ -21,12 +21,12 @@ class GoodsService implements GoodsServiceInterface
{ {
if (empty($goods)) { if (empty($goods)) {
return ErrorCode::GOODS_ON_SALE_NO;
return ErrorCode::GOODS_NOT_EXISTS;
} }
// 商户歇业 // 商户歇业
if($goods->store->is_rest == 1){ if($goods->store->is_rest == 1){
return ErrorCode::GOODS_ON_SALE_NO;
return ErrorCode::STORE_REST;
} }
// 商品下架或已删除 // 商品下架或已删除
if($goods->on_sale == 0 || !is_null($goods->deleted_at)){ if($goods->on_sale == 0 || !is_null($goods->deleted_at)){

Loading…
Cancel
Save