-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmydistribution.php
136 lines (112 loc) · 3.92 KB
/
mydistribution.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/*+**********************************************************************************
* The contents of this file are subject to the 361CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: 361CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
session_start();
require_once(dirname(__FILE__) . "/config.inc.php");
require_once(dirname(__FILE__) . "/config.common.php");
require_once(dirname(__FILE__) . "/util.php");
if (isset($_SESSION['profileid']) && $_SESSION['profileid'] != '')
{
$profileid = $_SESSION['profileid'];
}
elseif (isset($_SESSION['accessprofileid']) && $_SESSION['accessprofileid'] != '')
{
$profileid = $_SESSION['accessprofileid'];
}
else
{
messagebox('错误', '请从微信公众号“特赞商城”或朋友圈中朋友分享链接进入本平台,如您确实采用上述方式仍然出现本信息,请与系统管理员联系。');
die();
}
if (isset($_SESSION['supplierid']) && $_SESSION['supplierid'] != '')
{
$supplierid = $_SESSION['supplierid'];
}
else
{
echo '{"code":201,"msg":"没有店铺ID!"}';
die();
}
try
{
$total = 0;
$levelsourcers = array();
$query = XN_Query::create('Content_count')->tag('supplier_profile_' . $profileid)
->filter('type', 'eic', 'supplier_profile')
->filter('my.deleted', '=', '0')
->filter('my.supplierid', '=', $supplierid)
->filter('my.onelevelsourcer', '=', $profileid)
->rollup()
->end(-1);
$query->execute();
$onelevelsourcer = $query->getTotalCount();
$total += $onelevelsourcer;
$levelsourcers['onelevelsourcer'] = $onelevelsourcer;
$query = XN_Query::create('Content_count')->tag('supplier_profile_' . $profileid)
->filter('type', 'eic', 'supplier_profile')
->filter('my.deleted', '=', '0')
->filter('my.supplierid', '=', $supplierid)
->filter('my.twolevelsourcer', '=', $profileid)
->rollup()
->end(-1);
$query->execute();
$twolevelsourcer = $query->getTotalCount();
$total += $twolevelsourcer;
$levelsourcers['twolevelsourcer'] = $twolevelsourcer;
$query = XN_Query::create('Content_count')->tag('supplier_profile_' . $profileid)
->filter('type', 'eic', 'supplier_profile')
->filter('my.deleted', '=', '0')
->filter('my.supplierid', '=', $supplierid)
->filter('my.threelevelsourcer', '=', $profileid)
->rollup()
->end(-1);
$query->execute();
$threelevelsourcer = $query->getTotalCount();
$total += $threelevelsourcer;
$levelsourcers['threelevelsourcer'] = $threelevelsourcer;
$levelsourcers['total'] = $total;
}
catch (XN_Exception $e)
{
$msg = $e->getMessage();
messagebox('错误', $msg);
die();
}
require_once('Smarty_setup.php');
$smarty = new vtigerCRM_Smarty;
$islogined = false;
if ($_SESSION['u'] == $_SESSION['profileid'])
{
$islogined = true;
}
$smarty->assign("islogined", $islogined);
$action = strtolower(basename(__FILE__, ".php"));
$recommend_info = checkrecommend();
$smarty->assign("share_info", $recommend_info);
$smarty->assign("supplier_info", get_supplier_info());
$profile_info = get_supplier_profile_info();
if (count($profile_info) > 0)
{
$smarty->assign("profile_info", $profile_info);
}
else
{
$smarty->assign("profile_info", get_profile_info());
}
$smarty->assign("levelsourcers", $levelsourcers);
$sysinfo = array();
$sysinfo['action'] = 'promotioncenter';
$sysinfo['date'] = date("md");
$sysinfo['api'] = $APISERVERADDRESS;
$sysinfo['http_user_agent'] = check_http_user_agent();
$sysinfo['domain'] = $WX_DOMAIN;
$sysinfo['width'] = $_SESSION['width'];
$smarty->assign("sysinfo",$sysinfo);
$smarty->display($action . '.tpl');
?>