Commit f10de4cc authored by pengfei's avatar pengfei

Merge branch 'colonel' into develop

# Conflicts:
#	application/services/marketing/MarketingService.php
parents 21868e23 9f9f48ab
......@@ -13,6 +13,7 @@ class MarketingPindan extends MysqlBase
const ACTIVITY_STATUS_NO_START = 1;
const ACTIVITY_STATUS_IN_PROGRESS = 2;
const ACTIVITY_STATUS_FINISHED = 3;
const ACTIVITY_STATUS_START_TODAY = 4;//今日上新
public static function getRecord($where, $colums = [])
{
......
......@@ -29,7 +29,11 @@ class TakePlace extends MysqlBase
$keywords = $params['keywords'] ?? '';
$offset = $params['offset'] ?? 0;
$limit = $params['limit'] ?? 20;
$takePlaceIds = $params['take_place_id'] ?? [];
if(!empty($takePlaceIds)) {
$where['take_place_id'] = $takePlaceIds;
}
if($lifeAccountId) {
$where['life_account_id'] = $lifeAccountId;
}
......
......@@ -36,21 +36,23 @@ class ColonelorderController extends Cli
public function indexAction()
{
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:start');
$userIdList = $this->getColonelUserIds();
if (empty($userIdList) || empty($this->colonelConfigList)) {
return true;
}
$userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE);
$colonelPayInfoData = [];
foreach ($userIdList as $userIds) {
$batchPayInfoData = [];
// 完成目标单数
$batchPayInfoData[] = $this->getInviteOrderData($userIds);
// 邀请新用户奖励
$batchPayInfoData[] = $this->getInviteNewUserData($userIds);
$colonelPayInfoData = array_merge($colonelPayInfoData, $batchPayInfoData);
if (!empty($userIdList) && !empty($this->colonelConfigList)) {
$userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE);
$colonelPayInfoData = [];
foreach ($userIdList as $userIds) {
$batchPayInfoData = [];
// 完成目标单数
$batchPayInfoData[] = $this->getInviteOrderData($userIds);
// 邀请新用户奖励
$batchPayInfoData[] = $this->getInviteNewUserData($userIds);
$colonelPayInfoData = array_merge($colonelPayInfoData, $batchPayInfoData);
}
$this->handleSavePayInfo($colonelPayInfoData);
}
return $this->handleSavePayInfo($colonelPayInfoData);
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:end');
echo "success";
}
/**
......@@ -60,6 +62,7 @@ class ColonelorderController extends Cli
*/
public function handleSavePayInfo($colonelPayInfoData)
{
FileLog::info("colonel_distributor_order", '团长分销-计算奖励脚本:colonelPayInfoCount='.count($colonelPayInfoData));
if (!empty($colonelPayInfoData)) {
$data = $this->addIdgenId($colonelPayInfoData);
try {
......
......@@ -13,8 +13,10 @@ class ColonelwalletController extends Cli
{
public function indexAction()
{
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:start');
$yesterday = date("Y-m-d", strtotime("-1 day"));
$payInfoList = $this->getPayInfo($yesterday);
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:payInfoCount='.count($payInfoList));
if (!empty($payInfoList)) {
if ($this->toWallet($payInfoList)) {
if ($this->deductingInventory($payInfoList)) {
......@@ -22,6 +24,8 @@ class ColonelwalletController extends Cli
}
}
}
FileLog::info("colonel_distributor_wallet", '团长分销-奖励钱包脚本:end');
echo "success";
}
/**
......
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 1:36 下午
*/
use App\Base\Job;
class ColonelOrderController extends Job
{
public function indexAction()
{
\Yaf\Application::app()->bootstrap()->getDispatcher()->dispatch(new \Yaf\Request\Simple('', 'cli', 'colonelorder', 'index', []));
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 2:28 下午
*/
use App\Base\Job;
class ColonelWalletController extends Job
{
public function indexAction()
{
\Yaf\Application::app()->bootstrap()->getDispatcher()->dispatch(new \Yaf\Request\Simple('', 'cli', 'colonelwallet', 'index', []));
}
}
\ No newline at end of file
type=command
command=bash docker run --rm -e LANG=en_US.UTF-8 -e TZ=Asia/Shanghai --net=bridge -h "`hostname`" --cap-add SYS_PTRACE --privileged docker2.yidian.com:5000/publish/bp-goods-azkaban-test-10-image /bin/bash -c "cd /home/services && sh start_job.sh test ColonelOrder index a=3&b=4"
\ No newline at end of file
type=command
command=bash docker run --rm -e LANG=en_US.UTF-8 -e TZ=Asia/Shanghai --net=bridge -h "`hostname`" --cap-add SYS_PTRACE --privileged docker2.yidian.com:5000/publish/bp-goods-azkaban-test-10-image /bin/bash -c "cd /home/services && sh start_job.sh test ColonelWallet index a=3&b=4"
dependencies=run-colonel-order
\ No newline at end of file
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