Commit b9844c31 authored by luhongguang's avatar luhongguang

update:营销活动状态

parent 75674c8f
<?php
namespace Validate;
/**
* Class MarketingOnlineStatusValidate
*
* @package Validate
*/
class MarketingOnlineStatusValidate extends BaseValidate
{
protected $rule = [
'marketing_id' => 'require',
'marketing_type' => 'require',
'online_status' => 'require',
];
protected $message = [
"marketing_id" => "marketing_id 不能为空",
"marketing_type" => "marketing_type 不能为空",
"online_status" => "online_status 不能为空",
];
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ use App\Services\marketing\MarketingService;
use App\Exception\custom\MarketingException;
use App\Services\marketing\MarketingGoodsService;
use \Validate\MarketingGoodsRateValidate;
use \Validate\MarketingOnlineStatusValidate;
class MarketingController extends Base
{
......@@ -145,6 +146,8 @@ class MarketingController extends Base
*/
public function update_marketing_online_statusAction()
{
(new MarketingOnlineStatusValidate())->validate();
MarketingService::updateMarketingOnlineStatus($this->params);
$this->success();
}
......
......@@ -681,20 +681,11 @@ class MarketingService
$maxPrice = end($uniquePriceList);
Marketing::beginTransaction();
$onlineStatus = Marketing::ONLINE_STATUS_DAOQI;
if ($params["online_status"] == Marketing::ONLINE_STATUS_QIDONG) {
$onlineStatus = Marketing::ONLINE_STATUS_QIDONG;
$endTime = date("Y-m-d H:i:s", strtotime("+7 day"));
}
if ($params["online_status"] == Marketing::ONLINE_STATUS_GUANBI) {
$onlineStatus = Marketing::ONLINE_STATUS_GUANBI;
$endTime = date("Y-m-d H:i:s");
}
$marketingParams = [
'marketing_name' => $marketingName,
'start_time' => $startTime,
'end_time' => $endTime,
'online_status' => $onlineStatus,
'online_status' => Marketing::ONLINE_STATUS_QIDONG,
'marketing_type' => $type,
'good_count' => count($goodsSkuId),
'update_user_email' => $createUserEmail,
......
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