Commit aab21e3a authored by pengfei's avatar pengfei

update 团长分销-奖励脚本,修改调用钱包service_name

parent 29b46363
...@@ -17,6 +17,7 @@ use App\Models\marketing\mysql\Marketing; ...@@ -17,6 +17,7 @@ use App\Models\marketing\mysql\Marketing;
use App\Models\user\mysql\UserWechatBind; use App\Models\user\mysql\UserWechatBind;
use App\Services\marketing\PindanActivityColonelConfigService; use App\Services\marketing\PindanActivityColonelConfigService;
use Api\PhpUtils\Log\JobLog; use Api\PhpUtils\Log\JobLog;
use App\Services\marketing\ColonelService;
class ColonelorderController extends Job class ColonelorderController extends Job
{ {
...@@ -278,7 +279,7 @@ class ColonelorderController extends Job ...@@ -278,7 +279,7 @@ class ColonelorderController extends Job
if (!$url = config('interface', 'coupon.capitalpool.detail')) { if (!$url = config('interface', 'coupon.capitalpool.detail')) {
throw new Exception('没有capitalpool配置'); throw new Exception('没有capitalpool配置');
} }
if (!$marketing = $this->getMarketingInfo()) { if (!$marketing = ColonelService::getMarketingInfo()) {
throw new Exception('没有获取到资金池'); throw new Exception('没有获取到资金池');
} }
$httpParams = [ $httpParams = [
...@@ -321,24 +322,6 @@ class ColonelorderController extends Job ...@@ -321,24 +322,6 @@ class ColonelorderController extends Job
} }
} }
/**
* Notes: 获取团长分销活动
* User: pengfei@yidian-inc.com
* Date: 2021/9/9 6:06 下午
* @return array
*/
private function getMarketingInfo(): array
{
$where = [
'marketing_type' => Marketing::MARKETING_TYPE_TUANZHANG,
'ORDER' => ['marketing_id' => 'DESC'],
// 'online_status' => Marketing::ONLINE_STATUS_QIDONG TODO 待确认状态
];
$where['ORDER'] = ["create_time" => "DESC"];
$marketing = Marketing::getRecord($where, ['marketing_id', 'capital_pool_id']);
return (array)$marketing;
}
/** /**
* Notes: 加载配置 * Notes: 加载配置
* User: pengfei@yidian-inc.com * User: pengfei@yidian-inc.com
......
...@@ -9,14 +9,28 @@ use App\Base\Job; ...@@ -9,14 +9,28 @@ use App\Base\Job;
use App\Models\marketing\mysql\ColonelDistributorPayInfo; use App\Models\marketing\mysql\ColonelDistributorPayInfo;
use Api\PhpUtils\Http\HttpUtil; use Api\PhpUtils\Http\HttpUtil;
use Api\PhpUtils\Log\JobLog; use Api\PhpUtils\Log\JobLog;
use App\Services\marketing\ColonelService;
class ColonelwalletController extends Job class ColonelwalletController extends Job
{ {
const CAPITAL_POOL_ID = 2; // 资金池id
const CAPITAL_POOL_OP = 200; //200:团长奖励 const CAPITAL_POOL_OP = 200; //200:团长奖励
const WALLET_SERVICE_NAME = 11; // 10生活圈优惠券,11营销活动 const WALLET_SERVICE_NAME = 10; // 10生活圈优惠券,11营销活动
const WALLET_SOURCE_NAME = 1; //使用方名,1生活圈,2主端 const WALLET_SOURCE_NAME = 1; //使用方名,1生活圈,2主端
public $capitalPoolId = null;
/**
* Notes: 初始化-读取配置
* User: pengfei@yidian-inc.com
* Date: 2021/9/10 10:01 上午
*/
public function init()
{
parent::init();
$marketing = ColonelService::getMarketingInfo();
$this->capitalPoolId = $marketing['capital_pool_id'] ?? 0;
}
/** /**
* Notes: 奖励结算脚本 * Notes: 奖励结算脚本
* User: pengfei@yidian-inc.com * User: pengfei@yidian-inc.com
...@@ -95,7 +109,7 @@ class ColonelwalletController extends Job ...@@ -95,7 +109,7 @@ class ColonelwalletController extends Job
throw new Exception('没有grant_user_amount配置'); throw new Exception('没有grant_user_amount配置');
} }
$httpParams = [ $httpParams = [
'capital_pool_id' => self::CAPITAL_POOL_ID 'capital_pool_id' => $this->capitalPoolId
]; ];
$body = []; $body = [];
foreach ($payInfoList as $payInfo) { foreach ($payInfoList as $payInfo) {
......
...@@ -12,6 +12,7 @@ use App\Models\marketing\mysql\ColonelDistributorColonel; ...@@ -12,6 +12,7 @@ use App\Models\marketing\mysql\ColonelDistributorColonel;
use App\Models\marketing\mysql\ColonelDistributorColonelApply; use App\Models\marketing\mysql\ColonelDistributorColonelApply;
use App\Models\marketing\mysql\TakePlace; use App\Models\marketing\mysql\TakePlace;
use App\Models\user\mysql\UserWechatBind; use App\Models\user\mysql\UserWechatBind;
use App\Models\marketing\mysql\Marketing;
use Exception; use Exception;
class ColonelService class ColonelService
...@@ -323,4 +324,21 @@ class ColonelService ...@@ -323,4 +324,21 @@ class ColonelService
$takePlaces = TakePlace::getRecords(['take_place_id' => $takePlaceId]); $takePlaces = TakePlace::getRecords(['take_place_id' => $takePlaceId]);
return array_column((array)$takePlaces, null, 'take_place_id'); return array_column((array)$takePlaces, null, 'take_place_id');
} }
/**
* Notes: 获取团长分销活动
* User: pengfei@yidian-inc.com
* Date: 2021/9/9 6:06 下午
* @return array
*/
public static function getMarketingInfo(): array
{
$where = [
'marketing_type' => Marketing::MARKETING_TYPE_TUANZHANG,
'ORDER' => ['marketing_id' => 'DESC'],
];
$where['ORDER'] = ["create_time" => "DESC"];
$marketing = Marketing::getRecord($where, ['marketing_id', 'capital_pool_id']);
return (array)$marketing;
}
} }
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