Commit 29bec56a authored by luhongguang's avatar luhongguang

update:配置拼单商品必传字段

parent 8f7f412f
<?php
namespace Validate;
/**
* Class PindanGoodsAddValidate
*
* @package Validate
*/
class PindanGoodsAddValidate extends BaseValidate
{
protected $rule = [
'marketing_name' => 'require',
'goods_name' => 'require|length:1,50',
'price' => 'require',
'inventory' => 'require',
];
protected $message = [
'marketing_name' => 'marketing_name 不能为空',
'goods_name' => '请检查商品名称,内容不能太长或者不填写',
'price' => '请填写售价',
'inventory' => '请填写库存',
];
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ use \Validate\RefundGoodsValidate; ...@@ -15,6 +15,7 @@ use \Validate\RefundGoodsValidate;
use \Validate\GoodsOnlineOfflineValidate; use \Validate\GoodsOnlineOfflineValidate;
use \Validate\PaySuccessGoodsCallbackValidate; use \Validate\PaySuccessGoodsCallbackValidate;
use \Validate\GoodsInitShopValidate; use \Validate\GoodsInitShopValidate;
use \Validate\PindanGoodsAddValidate;
use \App\Services\goods\ElasticGoodService; use \App\Services\goods\ElasticGoodService;
use \App\Services\goods\MarketingPindanGoodsService; use \App\Services\goods\MarketingPindanGoodsService;
use \App\Models\marketing\mysql\Marketing; use \App\Models\marketing\mysql\Marketing;
...@@ -50,7 +51,7 @@ class GoodsController extends Base ...@@ -50,7 +51,7 @@ class GoodsController extends Base
{ {
$params = $this->params; $params = $this->params;
if (!empty($params["marketing_type"]) && $params["marketing_type"] == Marketing::MARKETING_TYPE_PINDAN) { if (!empty($params["marketing_type"]) && $params["marketing_type"] == Marketing::MARKETING_TYPE_PINDAN) {
(new PindanGoodsAddValidate())->validate();
} else { } else {
(new GoodsAddValidate())->validate(); (new GoodsAddValidate())->validate();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment