最近在开发美丽天天秒系统中,对产品用户体验了解得非常深入,现在是社交电商时代,我们在开发程序的过程中基于社交属性的玩法,基于朋友关系分享利他属性去做电商程序的设计至关重要,美丽天天秒系统也是我在在开发电商系统中感触比较深的一款自驱行为的社交电商系统,开发团队从产品设计里面、系统底层架构、程序代码逻辑、用户体验等功能深入考虑等等……
以下代码段是美丽天天秒系统分销分润核心代码
public function regionAgentDetail()
{
$title = '区域代理';
if (empty($this->uid)) {
return $this->outMessage($title, null, '-9999', "无法获取会员登录信息");
}
$nfx_region_agent = new NfxRegionAgent();
$shop_info = $nfx_region_agent->getShopRegionAgentConfig($this->instance_id);
$region_agent_info = $nfx_region_agent->getPromoterRegionAgentValidDetail($this->instance_id, $this->uid);
$address = new Address();
$address_info = $address->getProvinceName($region_agent_info['agent_provinceid']);
$agent_name = '省代';
if ($region_agent_info['agent_type'] > 1) {
$address_info .= $address->getCityName($region_agent_info['agent_cityid']);
$agent_name = '市代';
}
if ($region_agent_info['agent_type'] > 2) {
$address_info .= $address->getDistrictName($region_agent_info['agent_districtid']);
$agent_name = '区代';
}
$nfx_user = new NfxUser();
$user_account = $nfx_user->getNfxUserAccount($this->uid, $this->instance_id); // 佣金
if ($region_agent_info["agent_type"] == 1) {
$rate = $shop_info["province_rate"];
} elseif ($region_agent_info["agent_type"] == 2) {
$rate = $shop_info["city_rate"];
} else {
$rate = $shop_info["district_rate"];
}
$data = array(
'agent_name' => $agent_name,
'address_info' => $address_info,
'commission_region_agent' => $user_account['commission_region_agent'],
'rate' => $rate
);
return $this->outMessage($title, $data);
}
/**
* 分销商申请检测
*/
public function checkApplyPromoter()
{
$title = '分销商申请信息';
if (empty($this->uid)) {
return $this->outMessage($title, null, '-9999', "无法获取会员登录信息");
}
$reapply = isset($this->params['reapply']) ? $this->params['reapply'] : 0;
// 分销商信息表
$nfx_promoter = new NfxPromoter();
$promoter_info = $nfx_promoter->getUserPromoter($this->uid);
$shop_config = new NfxShopConfig();
$nfx_shop_config = $shop_config->getShopConfigDetail();
if ($nfx_shop_config['is_distribution_enable'] == 0) {
return $this->outMessage($title, null, -10, '当前店铺未开启分销');
}
$promoter_info = empty($promoter_info) ? null : $promoter_info;
// 获取店铺分销商等级
$promoter_level = $nfx_promoter->getPromoterLevelAll($this->instance_id, "level_money asc");
if (empty($promoter_level)) {
return $this->outMessage($title, null, -10, '当前未设置分销商');
}
// 获取用户在本店的消费
$member_service = new MemberService();
$uid = $this->uid;
$user_consume = $member_service->getShopUserConsume($uid);
$data = array(
'reapply' => $reapply,
'user_consume' => $user_consume,
'promoter_level' => $promoter_level,
'promoter_info' => $promoter_info
);
return $this->outMessage($title, $data);
}