|
@@ -284,7 +284,7 @@ class UserStatisticsService extends BaseService
|
|
* @param mixed $miniProgramId 小程序id
|
|
* @param mixed $miniProgramId 小程序id
|
|
*/
|
|
*/
|
|
public static function historyStats(int $accountId, $type,$miniProgramId)
|
|
public static function historyStats(int $accountId, $type,$miniProgramId)
|
|
- {
|
|
|
|
|
|
+ { print_sql();
|
|
$month = self::getStaticsData($accountId, date('Y-m-01'), date('Y-m-d', strtotime('yesterday')), $type,$miniProgramId);
|
|
$month = self::getStaticsData($accountId, date('Y-m-01'), date('Y-m-d', strtotime('yesterday')), $type,$miniProgramId);
|
|
$lastMonth = self::getStaticsData($accountId, date('Y-m-01', strtotime(date('Y-m-01')) - 10), date('Y-m-d', strtotime(date('Y-m-01')) - 10), $type,$miniProgramId);
|
|
$lastMonth = self::getStaticsData($accountId, date('Y-m-01', strtotime(date('Y-m-01')) - 10), date('Y-m-d', strtotime(date('Y-m-01')) - 10), $type,$miniProgramId);
|
|
$history = self::getHistoryData($accountId, $type,$miniProgramId);
|
|
$history = self::getHistoryData($accountId, $type,$miniProgramId);
|
|
@@ -306,9 +306,9 @@ class UserStatisticsService extends BaseService
|
|
if ($type == 2) {
|
|
if ($type == 2) {
|
|
$sql->where('puser_id', $accountId);
|
|
$sql->where('puser_id', $accountId);
|
|
} elseif ($type == 3) {
|
|
} elseif ($type == 3) {
|
|
- $sql->where('puser_id', $accountId);
|
|
|
|
|
|
+ $sql->where('user_id', $accountId);
|
|
}
|
|
}
|
|
- if ($minId) {
|
|
|
|
|
|
+ if ($minId > 0) {
|
|
$sql->where('miniprogram_id', $minId);
|
|
$sql->where('miniprogram_id', $minId);
|
|
}
|
|
}
|
|
$info = $sql->select(
|
|
$info = $sql->select(
|
|
@@ -338,9 +338,9 @@ class UserStatisticsService extends BaseService
|
|
if ($type == 2) {
|
|
if ($type == 2) {
|
|
$sql->where('puser_id', $accountId);
|
|
$sql->where('puser_id', $accountId);
|
|
} elseif ($type == 3) {
|
|
} elseif ($type == 3) {
|
|
- $sql->where('puser_id', $accountId);
|
|
|
|
|
|
+ $sql->where('user_id', $accountId);
|
|
}
|
|
}
|
|
- if ($minId) {
|
|
|
|
|
|
+ if ($minId > 0) {
|
|
$sql->where('miniprogram_id', $minId);
|
|
$sql->where('miniprogram_id', $minId);
|
|
}
|
|
}
|
|
return self::handleStaticData($sql);
|
|
return self::handleStaticData($sql);
|