Commit 2ea3809a authored by luhongguang's avatar luhongguang

update:临时提交

parent 3fb1e7bf
......@@ -13,6 +13,7 @@ class Marketing extends MysqlBase
const MARKETING_TYPE_FENXIAO = 1;
const MARKETING_TYPE_TUANGOU = 2;
const MARKETING_TYPE_MIAOSHA = 3;
const MARKETING_TYPE_JIELONG = 4;
public static function getRecord($where, $colums = [])
{
......
......@@ -173,13 +173,35 @@ class MarketingService
}
/**
* 创建互动
*
* 创建活动
* @param $params
* @return array|mixed
* @return \Api\PhpUtils\Mysql\MysqlBase|array
* @throws MarketingException
* @throws \App\Exception\custom\CodeSpecialException
*/
public static function addMarketing($params){
public static function addMarketing($params)
{
$marketingType = !empty($params['marketing_type']) ? $params['marketing_type'] : Marketing::MARKETING_TYPE_FENXIAO;
if ($marketingType == Marketing::MARKETING_TYPE_FENXIAO) {
return self::addFenxiaoMarketing($params);
} else if ($marketingType == Marketing::MARKETING_TYPE_TUANGOU) {
return [];
} else if ($marketingType == Marketing::MARKETING_TYPE_MIAOSHA) {
return [];
} else if ($marketingType == Marketing::MARKETING_TYPE_JIELONG) {
return self::addJielongMarketing($params);
}
}
/**
* 增加分销活动
* @param $params
* @return \Api\PhpUtils\Mysql\MysqlBase
* @throws MarketingException
* @throws \App\Exception\custom\CodeSpecialException
*/
private static function addFenxiaoMarketing($params)
{
$marketingName = !empty($params['marketing_name']) ? $params['marketing_name'] : '';
$firstCommissionRate = !empty($params['first_commission_value']) ? $params['first_commission_value']*100 : 0;
$secondCommissionRate = !empty($params['second_commission_value']) ? $params['second_commission_value']*100 : 0;
......@@ -329,6 +351,11 @@ class MarketingService
}
}
private static function addJielongMarketing($params)
{
return [];
}
/**
* 更新数据
*
......
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