Commit d56bb8f2 authored by jianghaiming's avatar jianghaiming

Merge branch 'develop' of https://gitlab.yidian-inc.com/bp/goods into develop

parents 786b8f8f 11196bee
<?php
namespace Validate;
/**
* Class CheckIsDistributorValidate
*
* @package Validate
*/
class CheckIsDistributorValidate extends BaseValidate
{
protected $rule = [
'user_id' => 'require',
];
protected $message = [
"user_id" => "用户id不能为空",
];
}
\ No newline at end of file
......@@ -4,6 +4,9 @@ use App\Base\Base;
use App\Services\marketing\DistributorService;
use App\Exception\custom\DistributorException;
use Api\PhpUtils\Validate\Validate;
use \Validate\CheckIsDistributorValidate;
class DistributorController extends Base
{
/**
......@@ -170,8 +173,22 @@ class DistributorController extends Base
}
/**
* 判断是否是团长
* @throws Exception
*/
public function is_distributorAction()
{
(new CheckIsDistributorValidate())->validate();
$params = $this->params;
$distributorList = DistributorService::getDistributorInfo([$params["user_id"]]);
if (!empty($distributorList[$params["user_id"]])) {
$this->success(["is_distributor"=>true]);
}
$this->success(["is_distributor"=>false]);
}
......
......@@ -712,6 +712,10 @@ class GoodsService
$distributorList = DistributorService::getDistributorInfo($params["user_id"]);
if (!empty($distributorList)) {
$data["goods_info"]["is_tuanzhang"] = true;
if (!empty($runningMarketing)) {
//分销返现多少钱
$data["goods_info"]["cash_back"] = $runningMarketing[$sku["goods_sku_id"]] * $data["goods_info"]["price"];
}
}
}
}
......@@ -807,6 +811,10 @@ class GoodsService
$distributorList = DistributorService::getDistributorInfo($params["user_id"]);
if (!empty($distributorList)) {
$data["goods_info"]["is_tuanzhang"] = true;
if (!empty($runningMarketing)) {
//分销返现多少钱
$data["goods_info"]["cash_back"] = $runningMarketing[$params["goods_sku_id"]] * $data["goods_info"]["price"];
}
}
}
return $data;
......
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