Commit 0e98cead authored by jianghaiming's avatar jianghaiming

update:修改冲突

parents 99a712e2 356401b9
......@@ -22,27 +22,34 @@ class BaseException extends \Exception
*/
public function __construct($params = [])
{
if (!is_array($params)) {
if (empty($params)) {
return;
}
if (!is_array($params)) {
return $this->setCusMsg($params);
}
$this->code = $params['code'] ?? Registry::get('config')->exception->user->code;
$this->msg = $params['msg'] ?? Registry::get('config')->exception->user->msg;
if (isset($params['cus']) && $this->cus && isset($this->cus[intval($params['cus'])]) && $this->base_code) {
return $this->setCusMsg($params['cus']);
}
}
public function setCusMsg($cus)
{
//每个服务都有自己的codePrefix
$appid = \Yaf\Application::app()->getConfig()->get("appid");
$codePrefix = \Yaconf::get('bizcode.prefix.' . $appid);
$codePrefix = intval($codePrefix);
$cus_code = intval($params['cus']);
$cus_code = intval($cus);
$base_code = intval($this->base_code);
$this->code = $codePrefix + $base_code + $cus_code;
$this->msg = isset($params['data']) ? vsprintf($this->cus[$cus_code],$params['data']) : $this->cus[$cus_code];
}
}
public function __get($name): bool
{
......
......@@ -3,7 +3,6 @@
namespace App\Exception\custom;
use App\Exception\BaseException;
class MarketingException extends BaseException
......@@ -13,6 +12,17 @@ class MarketingException extends BaseException
const LIFE_ACCOUNT_NO_EXIST = 16;
const RELATION_ALREADY_EXIST = 17;
const TAKE_PLACE_NOT_EXIST = 20;
const COLONEL_APPLY_EXIST = 23;
const COLONEL_APPLY_FAILED = 24;
const COLONEL_CONFIG_NULL = 25;
const COLONEL_LEVEL_SIX = 26;
const COLONEL_AUDIT_STATUS = 27;
const COLONEL_AUDIT_STATUS_FAILED = 28;
const COMMIT_ERROR = 29;
const COLONEL_TAKE_PLACE_EXIST = 30;
const COLONEL_TAKE_PLACE_PARAMS = 31;
const COLONEL_TAKE_PLACE_FAILED = 32;
protected $cus = [
0 => '活动名称不能为空',
......@@ -38,6 +48,16 @@ class MarketingException extends BaseException
self::TAKE_PLACE_NOT_EXIST => '自提点不存在',
21 => "活动开始时间不能大于或者等于结束时间",
22 => "自提点不能为空",
23 => '分润金额+手续费不能大于售价金额',
self::COLONEL_APPLY_EXIST => '当前用户已提交团长申请',
self::COLONEL_APPLY_FAILED => '团长申请失败',
self::COLONEL_CONFIG_NULL => "团长分销配置内容不能为空",
self::COLONEL_LEVEL_SIX => "档位最多设定6档",
self::COLONEL_AUDIT_STATUS => '团长审核状态错误',
self::COLONEL_AUDIT_STATUS_FAILED => '团长审核失败',
self::COMMIT_ERROR => '事务commit失败',
self::COLONEL_TAKE_PLACE_EXIST => '自提点名称已存在',
self::COLONEL_TAKE_PLACE_PARAMS => '自提点信息不存在',
self::COLONEL_TAKE_PLACE_FAILED => '自提点添加失败',
33 => '分润金额+手续费不能大于售价金额',
];
}
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 1:32 下午
*/
namespace Validate;
class ColonelAddPointValidate extends BaseValidate
{
protected $rule = [
'colonel_apply_id' => 'require',
'longitude' => 'require',
'latitude' => 'require',
'location' => 'require',
'address' => 'require',
'province' => 'require',
'city' => 'require',
'area' => 'require',
'contact_name' => 'require',
'phone' => 'isMobile',
'take_place_name' => 'require',
];
protected $message = [
'colonel_apply_id' => '申请id不能为空',
'longitude' => '位置经度不能为空',
'latitude' => '位置纬度不能为空',
'location' => '自提点地址不能为空',
'address' => '详细地址不能为空',
'province' => '省份不能为空',
'city' => '城市不能为空',
'area' => '地区不能为空',
'contact_name' => '联系人不能为空',
'phone' => '请输入正确的手机号',
'take_place_name' => '自提点名称不能为空',
];
}
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 3:11 下午
*/
namespace Validate;
class ColonelApplyValidate extends BaseValidate
{
protected $rule = [
'user_id' => 'require',
'phone' => 'isMobile',
'contact_name' => 'require',
];
protected $message = [
'user_id' => '用户id不能为空',
'phone' => '请输入正确的手机号',
'contact_name' => '联系人不能为空'
];
}
<?php
namespace Validate;
class ColonelAuditValidate extends BaseValidate
{
protected $rule = [
'colonel_apply_id' => 'require',
'audit_status' => 'require',
];
protected $message = [
"colonel_apply_id" => "申请id不能为空",
"audit_status" => "审核状态不能为空",
];
}
<?php
namespace Validate;
class ColonelCenterValidate extends BaseValidate
{
protected $rule = [
'user_id' => 'require',
];
protected $message = [
'user_id' => 'user_id 参数不能为空',
];
}
\ No newline at end of file
<?php
namespace Validate;
class ColonelConfigValidate extends BaseValidate
{
protected $rule = [
'date' => 'require',
'config' => 'require',
];
protected $message = [
'date' => 'date 参数不能为空',
'config' => 'config 参数不能为空',
'marketing_id' => 'marketing_id 参数不能为空',
];
public function sceneDate()
{
return $this->only(["date"])->append("date", "require");
}
public function sceneAdd()
{
return $this->only(["date","config","marketing_id"])->append("marketing_id", "require");
}
}
\ No newline at end of file
......@@ -22,4 +22,9 @@ class MarketingOnlineStatusValidate extends BaseValidate
"marketing_type" => "marketing_type 不能为空",
"online_status" => "online_status 不能为空",
];
public function sceneYingxiao()
{
return $this->only(['marketing_id','online_status']);
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 1:46 下午
*/
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorColonel extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_colonel';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'colonel_id';
const COLONEL_SOURCE_APPLY = 1; //用户申请
const COLONEL_SOURCE_ADMIN = 2; //运营添加
const DEFAULT_COLUMN = ['colonel_id','user_id','take_place_id','phone','contact_name','colonel_source'];
public static function getRecord(array $where, $column = '*')
{
return self::get($column, $where);
}
public static function getRecords(array $where, $column = '*')
{
return self::select($column, $where);
}
public static function updateRecord(array $columns, array $where)
{
return self::update($columns, $where);
}
public static function insertRecord(array $column) : int
{
$id = self::insert($column);
return intval($id);
}
public static function getPages(array $where = [], $column = '*', int $page, int $pageSize, array $orderBy = ['colonel_apply_id' => 'DESC'])
{
if (empty($column)) {
$column = self::DEFAULT_COLUMN;
}
$data = $where;
$count = self::count([], $where);
if (empty($count)) {
return ['list' => [],'count' => 0];
}
if (!empty($page) && !empty($pageSize)) {
$offset = ($page - 1) * $pageSize;
$data['LIMIT'] = [$offset,$pageSize];
}
if (!empty($orderBy)) {
$data['ORDER'] = $orderBy;
}
$result = self::select($column, $data);
return ['result' => $result,'count' => $count];
}
}
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 2:38 下午
*/
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorColonelApply extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_colonel_apply';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'colonel_apply_id';
const STATUS_AUDIT = 0;//待审核
const STATUS_PASS = 1;//审核通过
const STATUS_REJECT = 2;//审核驳回
const DEFAULT_COLUMN = ['colonel_apply_id','audit_status','user_id','phone','contact_name','take_place_name','province','city','area','location'];
public static function insertRecord(array $column) : int
{
$id = self::insert($column);
return intval($id);
}
public static function getRecord(array $where, $column = '*')
{
return self::get($column, $where);
}
public static function updateRecord(array $columns, array $where)
{
return self::update($columns, $where);
}
public static function getPages(array $where = [], $column = '*', int $page, int $pageSize, array $orderBy = ['colonel_apply_id' => 'DESC'])
{
if (empty($column)) {
$column = self::DEFAULT_COLUMN;
}
$data = $where;
$count = self::count([], $where);
if (empty($count)) {
return ['list' => [],'count' => 0];
}
if (!empty($page) && !empty($pageSize)) {
$offset = ($page - 1) * $pageSize;
$data['LIMIT'] = [$offset,$pageSize];
}
if (!empty($orderBy)) {
$data['ORDER'] = $orderBy;
}
$result = self::select($column, $data);
return ['result' => $result,'count' => $count];
}
public static function existUser(string $userId) : bool
{
$exist = self::getRecord(['user_id' => $userId], ['colonel_apply_id']);
return !empty($exist);
}
}
<?php
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorConfig extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_colonel_config';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'colonel_config_id';
const TYPE_COLONEL = 1;//团长分销活动
public static function getRecord($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::get($columns, $where, $options);
}
public static function getRecordMaster($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::selectMaster($columns, $where, $options);
}
public static function insertRecord($columns, $options = [])
{
return self::insert($columns, $options);
}
public static function updateRecord($columns, $where)
{
return self::update($columns, $where);
}
public static function save($data, $where = [], $options = [])
{
if (empty($where)) {
return self::insert($data, $options);
}
return self::update($data, $where);
}
public static function deleteRecord($where)
{
return self::delete($where);
}
}
\ No newline at end of file
<?php
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorInviteOrder extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_invite_order';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'invite_order_id';
const IS_REFUND_NO = 0;//未退款
const IS_REFUND_YES = 1;//已退款
public static function getRecord($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::get($columns, $where, $options);
}
public static function getRecordMaster($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::selectMaster($columns, $where, $options);
}
public static function insertRecord($columns, $options = [])
{
return self::insert($columns, $options);
}
public static function updateRecord($columns, $where)
{
return self::update($columns, $where);
}
public static function save($data, $where = [], $options = [])
{
if (empty($where)) {
return self::insert($data, $options);
}
return self::update($data, $where);
}
public static function deleteRecord($where)
{
return self::delete($where);
}
}
\ No newline at end of file
<?php
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorInviteOrderNum extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_invite_order_num';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'invite_order_num_id';
public static function getRecord($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::get($columns, $where, $options);
}
public static function getRecordMaster($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::selectMaster($columns, $where, $options);
}
public static function insertRecord($columns, $options = [])
{
return self::insert($columns, $options);
}
public static function updateRecord($columns, $where)
{
return self::update($columns, $where);
}
public static function save($data, $where = [], $options = [])
{
if (empty($where)) {
return self::insert($data, $options);
}
return self::update($data, $where);
}
public static function deleteRecord($where)
{
return self::delete($where);
}
}
\ No newline at end of file
<?php
namespace App\Models\marketing\mysql;
use Api\PhpUtils\Mysql\MysqlBase;
class ColonelDistributorPayInfo extends MysqlBase
{
const TABLE_NAME = 'colonel_distributor_pay_info';
const CONFIG_INDEX = 'marketing';
const PRIMARY_KEY = 'colonel_distributor_pay_info_id';
const TYPE_NEW_USER = 1;
const TYPE_FINISH_TARGET = 2;
public static $typeDesc = [
self::TYPE_NEW_USER => "邀请新用户",
self::TYPE_FINISH_TARGET => "完成目标单数",
];
public static function getRecord($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::get($columns, $where, $options);
}
public static function getRecordMaster($where, $columns = [], $options = [])
{
if (empty($columns)) {
$columns = '*';
}
return self::selectMaster($columns, $where, $options);
}
public static function insertRecord($columns, $options = [])
{
return self::insert($columns, $options);
}
public static function updateRecord($columns, $where)
{
return self::update($columns, $where);
}
public static function save($data, $where = [], $options = [])
{
if (empty($where)) {
return self::insert($data, $options);
}
return self::update($data, $where);
}
public static function deleteRecord($where)
{
return self::delete($where);
}
}
\ No newline at end of file
......@@ -14,6 +14,8 @@ class Marketing extends MysqlBase
const MARKETING_TYPE_TUANGOU = 2;
const MARKETING_TYPE_MIAOSHA = 3;
const MARKETING_TYPE_PINDAN = 4;
const MARKETING_TYPE_LIEBIAN = 5;
const MARKETING_TYPE_TUANZHANG = 6;
const ONLINE_STATUS_QIDONG = 1;
const ONLINE_STATUS_GUANBI = 2;
......@@ -125,6 +127,10 @@ class Marketing extends MysqlBase
$data['online_status'] = $where['online_status'];
}
if (!empty($where['marketing_type'])) {
$data['marketing_type'] = $where['marketing_type'];
}
return $data;
}
}
......@@ -49,4 +49,15 @@ class TakePlace extends MysqlBase
return $res;
}
public static function getRecord(array $where, $column = '*')
{
return self::get($column, $where);
}
public static function existTakePlaceName(string $takePlaceName) : bool
{
$exist = self::getRecord(['take_place_name' => $takePlaceName], ['take_place_id']);
return !empty($exist);
}
}
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 2:06 下午
*/
use App\Base\Base;
use App\Services\marketing\ColonelService;
use \Validate\ColonelApplyValidate;
use \Validate\ColonelConfigValidate;
use \Validate\ColonelAuditValidate;
use \Validate\ColonelCenterValidate;
use \Validate\ColonelAddPointValidate;
use \App\Services\marketing\PindanActivityColonelConfigService;
use \App\Services\marketing\PindanActivityInviteOrderService;
use \App\Services\user\UserService;
class ColonelController extends Base
{
/**
* Notes: 申请成为团长
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 3:21 下午
* @throws \App\Exception\custom\MarketingException
* @throws \App\Exception\custom\ParamException
*/
public function applyAction()
{
$params = $this->params;
(new ColonelApplyValidate())->validate();
$applyId = ColonelService::apply($params);
return $this->success(['result' => ['apply_id' => $applyId]]);
}
/**
* Notes: 是否已申请
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 9:56 上午
* @throws \App\Exception\custom\ParamException
*/
public function is_applyAction()
{
$params = $this->params;
(new ColonelCenterValidate())->validate();
$applyInfo = ColonelService::isApply($params['user_id']);
return $this->success(['result' => $applyInfo]);
}
/**
* 编辑团长分销配置
* @throws \App\Exception\custom\MarketingException
* @throws \App\Exception\custom\ParamException
*/
public function add_configAction()
{
(new ColonelConfigValidate())->scene('add')->validate();
$params = $this->params;
PindanActivityColonelConfigService::editColonelConfig($params);
return $this->success();
}
/**
* 查看团长分销配置
* @throws \App\Exception\custom\ParamException
*/
public function colonel_configAction()
{
(new ColonelConfigValidate())->scene("date")->validate();
$params = $this->params;
$data = PindanActivityColonelConfigService::colonelConfig($params);
return $this->success(["result" => $data]);
}
/**
* Notes: 管理后台 - 申请团长审核列表
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 2:17 下午
*/
public function manage_colonel_apply_listAction()
{
$params = $this->params;
$manageList = ColonelService::getManageApplyList($params);
return $this->success($manageList);
}
/**
* Notes: 管理后台 - 团长审核列表
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 3:09 下午
*/
public function manage_colonel_listAction()
{
$params = $this->params;
$manageList = ColonelService::getManageList($params);
return $this->success($manageList);
}
/**
* Notes: 管理后台 - 申请团长审核
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 2:16 下午
* @throws \App\Exception\custom\MarketingException
*/
public function manage_auditAction()
{
$params = $this->params;
(new ColonelAuditValidate())->validate();
ColonelService::handleManageAudit($params['colonel_apply_id'], $params['audit_status']);
return $this->success();
}
/**
* Notes: 管理后台 - 获取自提点信息
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 2:43 下午
*/
public function manage_show_apply_pointAction()
{
$params = $this->params;
$colonelApply = ColonelService::getTakePlaceInfo($params['colonel_apply_id']);
return $this->success(['result' => $colonelApply]);
}
/**
* Notes: 管理后台 - 添加自提点信息
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 2:52 下午
* @throws \App\Exception\custom\MarketingException
* @throws \App\Exception\custom\ParamException
*/
public function manage_add_apply_pointAction()
{
$params = $this->params;
(new ColonelAddPointValidate())->validate();
$takePlaceId = ColonelService::handleAddTaskPlace($params);
return $this->success(['result' => ['take_place_id' => $takePlaceId]]);
}
/**
* 团长分销下单处理统计数据逻辑
* @throws \App\Exception\custom\MarketingException
*/
public function place_order_process_logicAction()
{
$params = $this->params;
$data = PindanActivityInviteOrderService::placeOrder($params);
return $this->success(["result" => $data]);
}
/**
* 团长分销下单处理统计数据逻辑
* @throws \App\Exception\custom\MarketingException
*/
public function refund_order_process_logicAction()
{
$params = $this->params;
$data = PindanActivityInviteOrderService::refundOrder($params);
return $this->success(["result" => $data]);
}
/**
* 团长分销,任务中心
* @throws Exception
*/
public function task_controlAction()
{
$params = $this->params;
$data = PindanActivityColonelConfigService::getTaskData($params);
return $this->success(["result" => $data]);
}
/**
* 团长分销,数据统计
* @throws Exception
*/
public function colonel_indexAction()
{
(new ColonelCenterValidate())->validate();
$params = $this->params;
$userId = $params["user_id"];
$user = [];
if (!empty($userId)) {
$wechatInfo = UserService::userWechatBind(["user_id" => $userId]);
if (!empty($wechatInfo)) {
$user = [
"user_id" => $wechatInfo[0]["user_id"],
"user_nick" => $wechatInfo[0]["user_nick"],
"user_avatar" => $wechatInfo[0]["user_avatar"]
];
}
$incomeData = PindanActivityInviteOrderService::incomeStatistics(["user_ids" => [$userId]]);
$orderNumData = PindanActivityInviteOrderService::inviteOrderNumberStatistics(["user_ids" => [$userId]]);
return $this->success(["result" => [
"income" => $incomeData[$userId],
"order_num" => $orderNumData[$userId],
"user" => $user]]);
}
return $this->success(["result" => []]);
}
/**
* 团长分销,账单详情
* @throws Exception
*/
public function bill_infoAction()
{
(new ColonelCenterValidate())->validate();
$params = $this->params;
$data = PindanActivityInviteOrderService::getPayInfoList($params);
return $this->success(["result" => $data]);
}
/**
* 团长分销,下单记录
* @throws \App\Exception\custom\ParamException
*/
public function invite_order_recordAction()
{
(new ColonelCenterValidate())->validate();
$params = $this->params;
$data = PindanActivityInviteOrderService::getInviteOrderRecord($params);
return $this->success(["result" => $data]);
}
}
......@@ -155,4 +155,25 @@ class MarketingController extends Base
$this->success();
}
/**
* 切换活动状态
* @throws \App\Exception\custom\ParamException
*/
public function toogle_yingxiao_online_statusAction()
{
(new MarketingOnlineStatusValidate())->scene('yingxiao')->validate();
$res = MarketingService::toogleOnlineStatus($this->params['marketing_id'],$this->params['online_status']);
$this->success(['result' => $res]);
}
/**
* 营销中心-活动列表
* @throws Exception
*/
public function yingxiao_listAction()
{
$lists = MarketingService::yingxiaoList($this->params);
$this->success(['result' => $lists]);
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 2:23 下午
*/
namespace App\Services\marketing;
use App\Exception\custom\MarketingException;
use App\Models\marketing\mysql\ColonelDistributorColonel;
use App\Models\marketing\mysql\ColonelDistributorColonelApply;
use App\Models\marketing\mysql\TakePlace;
use App\Models\user\mysql\UserWechatBind;
use Exception;
class ColonelService
{
/**
* Notes: 申请成为团长
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 4:29 下午
* @param array $params
* @return int $applyId
* @throws MarketingException
*/
public static function apply(array $params): int
{
if (ColonelDistributorColonelApply::existUser($params['user_id'])) {
throw new MarketingException(MarketingException::COLONEL_APPLY_EXIST);
}
$colonelData = [
'user_id' => $params['user_id'],
'life_account_id' => MarketingService::getPublicLifeAccountId(),
'phone' => $params['phone'],
'contact_name' => $params['contact_name'],
'take_place_name' => $params['take_place_name'],
'take_place_pic' => $params['take_place_pic'] ?? '',
'longitude' => $params['longitude'] ?? 0,
'latitude' => $params['latitude'] ?? 0,
'location' => $params['location'] ?? '',
'address' => $params['address'] ?? '',
'province' => $params['province'] ?? '',
'city' => $params['city'] ?? '',
'area' => $params['area'] ?? '',
];
try {
if (!empty($colonelData['take_place_name'])) {
$colonelData['take_place_name'] = "【团长】{$colonelData['take_place_name']}";
}
if (!$applyId = ColonelDistributorColonelApply::insertRecord($colonelData)) {
throw new MarketingException(MarketingException::COLONEL_APPLY_FAILED);
}
return $applyId;
} catch (Exception $e) {
throw new MarketingException(MarketingException::COLONEL_APPLY_FAILED);
}
}
/**
* Notes: 查看用户是否已申请
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 11:42 上午
* @param int $userId
* @return array
*/
public static function isApply(int $userId): array
{
$applyInfo = ColonelDistributorColonelApply::getRecord(['user_id' => $userId], ['colonel_apply_id','audit_status']);
return [
// -1.未申请 0.未审核 1.审核通过 2.审核未通过
'apply_status' => isset($applyInfo['audit_status']) ? intval($applyInfo['audit_status']) : -1
];
}
/**
* Notes: 团长申请列表-后台管理
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 8:15 下午
* @param array $params
* @return array
*/
public static function getManageApplyList(array $params): array
{
$params = self::getPageParams($params);
$result = ColonelDistributorColonelApply::getPages([], ColonelDistributorColonelApply::DEFAULT_COLUMN, $params['page'], $params['page_size']);
if (empty($result['count'])) {
return $result;
}
$userMap = self::getUserMap(array_column($result['result'], 'user_id'));
$takePlaceMap = self::getColonelTakePlaceMap(array_column($result['result'], 'colonel_apply_id'));
foreach ($result['result'] as &$applyVal) {
$applyVal['user_avatar'] = !empty($userMap[$applyVal['user_id']]['user_avatar']) ? $userMap[$applyVal['user_id']]['user_avatar'] : '';
// take_place_status 是否可以添加自提点 - 已审核通过并且未添加过自提点
$applyVal['take_place_status'] = 0;
if ($applyVal['audit_status'] == ColonelDistributorColonelApply::STATUS_PASS) {
if (empty($takePlaceMap[$applyVal['colonel_apply_id']]['take_place_id'])) {
$applyVal['take_place_status'] = 1;
}
}
}
unset($applyVal);
return $result;
}
/**
* Notes: 团长列表-后台管理
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 3:04 下午
* @param array $params
* @return array
*/
public static function getManageList(array $params): array
{
$params = self::getPageParams($params);
$result = ColonelDistributorColonel::getPages([], ColonelDistributorColonel::DEFAULT_COLUMN, $params['page'], $params['page_size']);
if (empty($result['count'])) {
return $result;
}
$userIds = array_column($result['result'], 'user_id');
$userMap = self::getUserMap($userIds);
$incomeMap = PindanActivityInviteOrderService::incomeStatistics(["user_ids" => $userIds]);
foreach ($result['result'] as &$colonelVal) {
$userId = $colonelVal['user_id'];
$colonelVal['user_avatar'] = !empty($userMap[$userId]['user_avatar']) ? $userMap[$userId]['user_avatar'] : '';
$colonelVal['yesterday_income'] = !empty($incomeMap[$userId]['yesterday_reward']) ? $incomeMap[$userId]['yesterday_reward'] : 0;
$colonelVal['total_income'] = !empty($incomeMap[$userId]['all_reward']) ? $incomeMap[$userId]['all_reward'] : 0;
}
unset($colonelVal);
return $result;
}
/**
* Notes: 团长申请审核
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 1:54 下午
* @param int $applyId
* @param int $auditStatus
* @return bool
* @throws MarketingException
*/
public static function handleManageAudit(int $applyId, int $auditStatus): bool
{
// 审核状态参数检测
if (!in_array($auditStatus, [ColonelDistributorColonelApply::STATUS_PASS,ColonelDistributorColonelApply::STATUS_REJECT])) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS);
}
// 审核状态数据检测
$applyInfo = ColonelDistributorColonelApply::getRecord(['colonel_apply_id' => $applyId]);
if (empty($applyInfo) || $applyInfo['audit_status'] != ColonelDistributorColonelApply::STATUS_AUDIT) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS);
}
try {
ColonelDistributorColonelApply::beginTransaction();
// 修改申请状态
$updateStatus = ColonelDistributorColonelApply::updateRecord(['audit_status' => $auditStatus], ['colonel_apply_id' => $applyId,'audit_status' => ColonelDistributorColonelApply::STATUS_AUDIT]);
if (empty($updateStatus)) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
}
// 审核成功
if ($auditStatus == ColonelDistributorColonelApply::STATUS_PASS) {
if (!self::handleAuditSuccess((array)$applyInfo)) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
}
}
if (!ColonelDistributorColonelApply::commit()) {
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
}
return true;
} catch (MarketingException $e) {
ColonelDistributorColonelApply::rollback();
throw new MarketingException(MarketingException::COLONEL_AUDIT_STATUS_FAILED);
}
}
/**
* Notes: 获取自提点信息
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 2:40 下午
* @param int $applyId
* @return array
*/
public static function getTakePlaceInfo(int $applyId): array
{
$where = [
'colonel_apply_id' => $applyId
];
$colonelApply = ColonelDistributorColonelApply::getRecord($where);
return (array)$colonelApply;
}
/**
* Notes: 添加自提点
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 2:41 下午
* @param array $params
* @return int
* @throws MarketingException
*/
public static function handleAddTaskPlace(array $params): int
{
// 自提点名称检测
if (TakePlace::existTakePlaceName($params['take_place_name'])) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_EXIST);
}
$where = [
'colonel_apply_id' => $params['colonel_apply_id']
];
// 自提点信息检测
if (!$colonelApply = ColonelDistributorColonelApply::getRecord($where)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_PARAMS);
}
$params['life_account_id'] = $colonelApply['life_account_id'];
$params['name'] = $params['take_place_name'];
try {
ColonelDistributorColonel::beginTransaction();
// 添加自提点
if (!$takePlaceId = TakePlaceService::add($params)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
}
// 修改自提点id
if (!ColonelDistributorColonel::updateRecord(['take_place_id' => $takePlaceId], $where)) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
}
if (!ColonelDistributorColonel::commit()) {
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
}
return (int)$takePlaceId;
} catch (MarketingException $e) {
ColonelDistributorColonel::rollback();
throw new MarketingException(MarketingException::COLONEL_TAKE_PLACE_FAILED);
}
}
/**
* Notes: 团长审核成功
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 11:24 上午
* @param array $applyInfo
* @return int
*/
private static function handleAuditSuccess(array $applyInfo): int
{
// 入库团长表
$colonelData = [
'user_id' => $applyInfo['user_id'],
'colonel_apply_id' => $applyInfo['colonel_apply_id'],
'take_place_id' => 0,
'life_account_id' => $applyInfo['life_account_id'],
'phone' => $applyInfo['phone'],
'contact_name' => $applyInfo['contact_name'],
'colonel_source' => ColonelDistributorColonel::COLONEL_SOURCE_APPLY
];
return ColonelDistributorColonel::insertRecord($colonelData);
}
/**
* Notes: 获取用户信息
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 8:16 下午
* @param array $userIds
* @return array
*/
private static function getUserMap(array $userIds): array
{
$userWechatList = UserWechatBind::getRecords(['user_id' => $userIds], ['user_id','user_nick','user_avatar']);
return array_column((array)$userWechatList, null, 'user_id');
}
/**
* Notes: 获取团长自提点
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 8:16 下午
* @param array $colonelApplyIds
* @return array
*/
private static function getColonelTakePlaceMap(array $colonelApplyIds): array
{
$colonels = ColonelDistributorColonel::getRecords(['colonel_apply_id' => $colonelApplyIds], ['colonel_apply_id','take_place_id']);
return array_column((array)$colonels, 'take_place_id', 'colonel_apply_id');
}
/**
* Notes: 获取默认页码
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 8:16 下午
* @param array $params
* @return int[]
*/
private static function getPageParams(array $params = []): array
{
$params['page'] = !empty($params['page']) ? $params['page'] : 1;
$params['page_size'] = !empty($params['page_size']) ? $params['page_size'] : 20;
return $params;
}
}
......@@ -6,6 +6,7 @@ namespace App\Services\marketing;
use Api\PhpServices\Ksy\Ks3Api;
use Api\PhpUtils\Http\HttpUtil;
use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\Request;
use App\Models\goods\mysql\Ota;
use App\Models\goods\mysql\PindanGoodsSku;
use App\Models\marketing\mysql\Marketing;
......@@ -147,6 +148,47 @@ class MarketingService
}
}
/**
* 营销中心-活动列表
* @param $params
* @return array
*/
public static function yingxiaoList($params)
{
$where["marketing_type"] = [Marketing::MARKETING_TYPE_LIEBIAN, Marketing::MARKETING_TYPE_TUANZHANG];
$where['ORDER'] = ["create_time" => "DESC"];
$lists = Marketing::getRecords($where);
if ($lists && is_array($lists)) {
$capitalPoolIds = array_column($lists, 'capital_pool_id');
//获取资金池列表信息
$url = config('interface', 'coupon.capitalpool.fetch_map_capitalpool');
$capitalPoolList = (new Request())->get($url, ["capital_pool_ids" => $capitalPoolIds]);
$capitalPoolList = $capitalPoolList['response']['result'] ?: [];
$poolTotal = $poolUsed = $poolLock = 0;
foreach ($lists as &$val) {
if($capitalPoolList[$val['capital_pool_id']]) {
$val['capital_pool'] = $capitalPoolList[$val['capital_pool_id']];
$poolTotal += $val['capital_pool']['capital_pool_total'];
$poolUsed += $val['capital_pool']['capital_pool_used'];
$poolLock += $val['capital_pool']['capital_pool_lock'];
}else {
$val['capital_pool'] = [];
}
$val['online_status_desc'] = Marketing::$onlineStatusDesc[$val['online_status']];
}
unset($val);
}
$poolbalance = $poolTotal - $poolUsed - $poolLock;
$poolAnalysis = ['total'=>$poolTotal,'used'=>$poolUsed,'lock'=>$poolLock,'balance'=>$poolbalance];
return ['anlysis'=>$poolAnalysis,'list' => $lists];
}
/**
* 分销活动列表
* @param $params
......@@ -851,6 +893,24 @@ class MarketingService
Marketing::updateRecord($marketingParams, ["marketing_id" => $marketingId, "marketing_type" => $marketingType]);
}
/**
* 切换活动状态
* @param $marketingId
* @param $onlineStatus
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public static function toogleOnlineStatus($marketingId,$onlineStatus)
{
if(!in_array($onlineStatus,array_keys(Marketing::$onlineStatusDesc))) {
return 0;
}
$data = [
'online_status' => $onlineStatus,
];
return Marketing::updateRecord($data, ["marketing_id" => $marketingId]);
}
/**
* 分销活动详情
* @param $params
......
<?php
namespace App\Services\marketing;
use App\Exception\custom\MarketingException;
use App\Models\marketing\mysql\ColonelDistributorInviteOrderNum;
use App\Models\marketing\mysql\Marketing;
use App\Models\marketing\mysql\ColonelDistributorConfig;
class PindanActivityColonelConfigService
{
/**
* 编辑团长分销活动配置
* @param array $params
* @return bool
* @throws MarketingException
*/
public static function editColonelConfig($params = [])
{
$date = $params["date"];
$type = empty($params["type"]) ? ColonelDistributorConfig::TYPE_COLONEL : $params["type"];
$configList = $params["config"];
$marketingId = $params["marketing_id"];
if (empty($configList)) {
throw new MarketingException(['cus' => MarketingException::COLONEL_CONFIG_NULL]);
}
if (count($configList) > 6) {
throw new MarketingException(['cus' => MarketingException::COLONEL_LEVEL_SIX]);
}
$idRes = ColonelDistributorConfig::getRecord(["date" => $date, "type" => $type, "marketing_id" => $marketingId], ["colonel_config_id"]);
if (!empty($idRes)) {
ColonelDistributorConfig::save([
"marketing_id" => $marketingId,
"date" => $date,
"type" => $type,
"data" => $configList,
], ["colonel_config_id" => $idRes["colonel_config_id"]]);
} else {
ColonelDistributorConfig::save([
"marketing_id" => $marketingId,
"date" => $date,
"type" => $type,
"data" => $configList,
]);
}
return true;
}
/**
* 团长分销活动配置
* @param array $params
* @return array
*/
public static function colonelConfig($params = [])
{
$day = empty($params["date"]) ? date("Y-m-d") : $params["date"];
$type = empty($params["type"]) ? ColonelDistributorConfig::TYPE_COLONEL : $params["type"];
$config = ColonelDistributorConfig::getRecord(["date" => $day, "type" => $type]);
if (empty($config)) {
$config = ColonelDistributorConfig::getRecord([
"date[<=]" => $day,
"ORDER" => ["date" => "DESC"],
"LIMIT" => 1
]);
}
$data = [];
if (!empty($config)) {
$configData = json_decode($config["data"], true);
foreach ($configData as $key => $item) {
$data[$key]["date"] = $config["date"];
$data[$key]["level"] = $item["level"];
$data[$key]["assess_order_num"] = $item["assess_order_num"];
$data[$key]["reward_amount"] = $item["reward_amount"];
}
$sortKeys = array_column($data, "level");
array_multisort($sortKeys, SORT_ASC, $data);
}
return $data;
}
/**
* 团长分销活动任务中心列表
* @param array $params
* @return array
*/
public static function getTaskData($params = [])
{
$hour = date("H");
if ($hour < 10 && $hour > 0) {
$date = date("Y-m-d", strtotime("-1 day"));
} elseif ($hour > 16) {
$date = date("Y-m-d");
} else {
$date = date("Y-m-d");
}
$num = 0;
if (!empty($params["user_id"])) {
$inviteOrderNumRes = ColonelDistributorInviteOrderNum::getRecord([
"colonel_user_id" => $params["user_id"],
"date" => $date,
]);
$num = empty($inviteOrderNumRes["num"]) ? 0 : $inviteOrderNumRes["num"];
}
$configList = self::colonelConfig(["date" => $date, "type" => ColonelDistributorConfig::TYPE_COLONEL]);
if (!empty($configList)) {
foreach ($configList as $key => $config) {
$configList[$key]["is_finish"] = 0;
if ($config["assess_order_num"] <= $num) {
$configList[$key]["is_finish"] = 1;
}
}
}
return ["number" => $num, 'list' => $configList];
}
}
\ No newline at end of file
<?php
namespace App\Services\marketing;
use App\Exception\custom\MarketingException;
use App\Models\marketing\mysql\ColonelDistributorColonel;
use App\Models\marketing\mysql\ColonelDistributorInviteOrder;
use App\Models\marketing\mysql\ColonelDistributorInviteOrderNum;
use App\Models\marketing\mysql\ColonelDistributorPayInfo;
use App\Services\user\UserService;
class PindanActivityInviteOrderService
{
/**
* 团长分销下单逻辑
* @param array $params
* @return bool
* @throws MarketingException
*/
public static function placeOrder($params = [])
{
$num = empty($params["num"]) ? 1 : $params["num"];
$inviteOrderData = [
"colonel_user_id" => $params["colonel_user_id"],
"user_id" => $params["user_id"],
"order_id" => $params["order_id"],
"refund_time" => null,
];
$inviteOrder = ColonelDistributorInviteOrder::selectMaster("*", $inviteOrderData, []);
if (!empty($inviteOrder)) {
return true;
}
$inviteOrderNumData = [
"colonel_user_id" => $params["colonel_user_id"],
"date" => date("Y-m-d"),
];
$inviteOrderNum = ColonelDistributorInviteOrderNum::selectMaster("*", $inviteOrderNumData, []);
ColonelDistributorInviteOrder::beginTransaction();
$addInviteOrderRes = ColonelDistributorInviteOrder::save($inviteOrderData);
if (!empty($inviteOrderNum)) {
$addInviteOrderNumRes = ColonelDistributorInviteOrderNum::save(["num[+]" => $num], ["invite_order_num_id" => $inviteOrderNum[0]["invite_order_num_id"]]);
} else {
$inviteOrderNumData["num"] = $num;
$addInviteOrderNumRes = ColonelDistributorInviteOrderNum::save($inviteOrderNumData);
}
if (empty($addInviteOrderRes) || empty($addInviteOrderNumRes) || !ColonelDistributorInviteOrder::commit()) {
ColonelDistributorInviteOrder::rollback();
throw new MarketingException(["cus" => MarketingException::COMMIT_ERROR]);
}
return true;
}
/**
* 团长分销退单逻辑
* @param array $params
* @return bool
* @throws MarketingException
*/
public static function refundOrder($params = [])
{
$orderId = $params["order_id"];
$inviteOrder = ColonelDistributorInviteOrder::selectMaster("*", ["order_id" => $orderId], []);
if (!empty($inviteOrder) && $inviteOrder[0]["is_refund"] == ColonelDistributorInviteOrder::IS_REFUND_NO) {
$inviteOrderData = [
"colonel_user_id" => $inviteOrder[0]["colonel_user_id"],
"user_id" => $inviteOrder[0]["user_id"],
"order_id" => $orderId,
];
$inviteOrderNumData = [
"colonel_user_id" => $inviteOrder[0]["colonel_user_id"],
"date" => date("Y-m-d"),
];
ColonelDistributorInviteOrder::beginTransaction();
$addInviteOrderRes = ColonelDistributorInviteOrder::save([
"is_refund" => ColonelDistributorInviteOrder::IS_REFUND_YES,
"refund_time" => date("y-m-d H:i:s")
], $inviteOrderData);
$addInviteOrderNumRes = ColonelDistributorInviteOrderNum::save(["num[-]" => 1], $inviteOrderNumData);
if (empty($addInviteOrderRes) || empty($addInviteOrderNumRes) || !ColonelDistributorInviteOrder::commit()) {
ColonelDistributorInviteOrder::rollback();
throw new MarketingException(["cus" => MarketingException::COMMIT_ERROR]);
}
}
return true;
}
/**
* 团长分销,昨日收入,总收入
* @param array $params
* @return array
*/
public static function incomeStatistics($params = [])
{
$userIds = $params["user_ids"];
$yesterday = date("Y-m-d", strtotime("-1 day"));
$yesterdayRewards = ColonelDistributorPayInfo::select(["colonel_user_id", "reward"], ["date" => $yesterday, "colonel_user_id" => $userIds], []);
$yesterdayData = [];
if (!empty($yesterdayRewards)) {
foreach ($yesterdayRewards as $item) {
$yesterdayData[$item["colonel_user_id"]][] = $item["reward"];
}
}
$allRewards = ColonelDistributorPayInfo::select(["colonel_user_id", "reward"], ["colonel_user_id" => $userIds], []);
$allData = [];
if (!empty($allRewards)) {
foreach ($allRewards as $item) {
$allData[$item["colonel_user_id"]][] = $item["reward"];
}
}
$data = [];
foreach ($userIds as $userId) {
$data[$userId]["yesterday_reward"] = 0;
$data[$userId]["all_reward"] = 0;
if (!empty($yesterdayData[$userId])) {
$data[$userId]["yesterday_reward"] = sprintf("%.2f", array_sum($yesterdayData[$userId]) / 100);
}
if (!empty($allData[$userId])) {
$data[$userId]["all_reward"] = sprintf("%.2f", array_sum($allData[$userId]) / 100);
}
}
return $data;
}
/**
* 团长分销,昨日转化单数,总转化单数
* @param array $params
* @return array
*/
public static function inviteOrderNumberStatistics($params = [])
{
$userIds = $params["user_ids"];
$yesterday = date("Y-m-d", strtotime("-1 day"));
$yesterdayNums = ColonelDistributorInviteOrderNum::select(["colonel_user_id", "num"],
["date" => $yesterday, "colonel_user_id" => $userIds], []);
$yesterdayData = array_column($yesterdayNums, null, "colonel_user_id");
$allNums = ColonelDistributorInviteOrderNum::select(["colonel_user_id", "num"], ["colonel_user_id" => $userIds], []);
$allData = array_column($allNums, null, "colonel_user_id");
$data = [];
foreach ($userIds as $userId) {
$data[$userId]["yesterday_order_num"] = 0;
$data[$userId]["all_order_num"] = 0;
if (!empty($yesterdayData[$userId])) {
$data[$userId]["yesterday_order_num"] = $yesterdayData[$userId]["num"];
}
if (!empty($allData[$userId])) {
$data[$userId]["all_order_num"] = $allData[$userId]["num"];
}
}
return $data;
}
/**
* 团长分销,账单详情
* @param array $params
* @return array
*/
public static function getPayInfoList($params = [])
{
$weekDay = date("Y-m-d", strtotime("-7 day"));
$userId = $params["user_id"];
if (empty($userId)) {
return [];
}
$payList = ColonelDistributorPayInfo::select("*", [
"colonel_user_id" => $userId,
"date[>=]" => $weekDay,
"ORDER" => ["date" => "DESC"]
], []);
$data = $res = [];
if (!empty($payList)) {
foreach ($payList as $item) {
$tempItem = [];
$tempItem["type"] = $item["type"];
$tempItem["type_desc"] = ColonelDistributorPayInfo::$typeDesc[$item["type"]];
$tempItem["invite_user_id"] = $item["invite_user_id"];
$tempItem["invite_user_nick"] = $item["invite_user_nick"];
$tempItem["reward"] = $item["reward"];
$tempItem["finish_num"] = $item["finish_num"];
$tempItem["status"] = $item["status"];
$data[$item["date"]][] = $tempItem;
}
foreach ($data as $key => $item) {
$rewards = array_column($item, "reward");
$total = array_sum($rewards);
$res[$key]["total"] = $total / 100;
$res[$key]["date"] = $key;
$res[$key]["data"] = $item;
foreach ($item as $k => $v) {
$res[$key]["data"][$k]["reward"] = $v["reward"] / 100;
}
}
}
return array_values($res);
}
/**
* 团长分销,下单记录
* @param array $params
* @return array
*/
public static function getInviteOrderRecord($params = [])
{
$userId = $params["user_id"];
$lastId = empty($params["last_id"]) ? "" : $params["last_id"];
$limit = empty($params["page_size"]) ? 10 : $params["page_size"];
$hour = date("H");
if ($hour < 10 && $hour > 0) {
$date = date("Y-m-d", strtotime("-1 day"));
} elseif ($hour > 16) {
$date = date("Y-m-d");
} else {
$date = date("Y-m-d");
}
$secondDay = date("Y-m-d", strtotime("$date +1 day"));
$startTime = $date." 16:00:00";
$endTime = $secondDay." 10:00:00";
$where = [];
$where["colonel_user_id"] = $userId;
$where["create_time[>]"] = $startTime;
$where["create_time[<]"] = $endTime;
$where["LIMIT"] = $limit;
$where["ORDER"] = ["invite_order_id" => "DESC"];
if (!empty($lastId)) {
$where["invite_order_id[<]"] = $lastId;
}
$list = ColonelDistributorInviteOrder::select(["invite_order_id", "user_id", "is_refund"], $where, []);
if (!empty($list)) {
$userIds = array_unique(array_column($list, "user_id"));
$userList = UserService::userWechatBind(["user_id"=>$userIds]);
if (!empty($userList)) {
$userList = array_column($userList, null, "user_id");
}
$count = count($list);
foreach ($list as $key => $item) {
if (!empty($userList[$item["user_id"]])) {
$list[$key]["user_nick"] = $userList[$item["user_id"]]["user_nick"];
$list[$key]["user_avatar"] = $userList[$item["user_id"]]["user_avatar"];
} else {
$list[$key]["user_nick"] = "";
$list[$key]["user_avatar"] = "";
}
$lastId = $item["invite_order_id"];
}
if ($count < $limit) {
$lastId = "-1";
}
} else {
$lastId = "-1";
}
return ["list" => $list, "last_id" => $lastId];
}
}
\ No newline at end of file
......@@ -54,7 +54,8 @@ class TakePlaceService
public static function add($params)
{
//验证life_account_id
if(isset($params['life_account_id'])) {
$lifeAccountId = MarketingService::getPublicLifeAccountId();
if(isset($params['life_account_id']) && $params['life_account_id'] != $lifeAccountId) {
$url = config('interface', 'merchant.lifeaccount.get_life_account_by_id');
$lifeAccountRes = (new Request())->get($url, ["life_account_id" => $params["life_account_id"]]);
......@@ -63,9 +64,9 @@ class TakePlaceService
}
}
$lifeAccountId = MarketingService::getPublicLifeAccountId();
$data['life_account_id'] = $params['life_account_id'] ?? $lifeAccountId;
$data['take_place_name'] = $params['name'];
$data['take_place_pic'] = $params['take_place_pic'] ?? '';
$data['longitude'] = $params['longitude'];
$data['latitude'] = $params['latitude'];
$data['location'] = $params['location'];
......
......@@ -193,6 +193,10 @@ class UserService
$data['user_id'] = $params['user_id'];
}
if (!empty($params['phone'])) {
$data['phone'] = $params['phone'];
}
$userList = UserWechatBind::getRecords($data);
return $userList;
}
......
......@@ -1891,6 +1891,7 @@ opcache.huge_code_pages=1
apc.shm_size=1024M
apc.slam_defense=1
apc.serializer=igbinary
apc.enable_cli=1
[memcached]
memcached.sess_connect_timeout=1000
......
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