|
|
@@ -10,6 +10,12 @@ use biz\merchant\services\MerchantExtendService;
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
use biz\order\services\OrderGoodsService;
|
|
|
use biz\order\services\OrderService;
|
|
|
+use biz\stat\models\StatOrderMonth;
|
|
|
+use biz\stat\services\StatIncomeMonthService;
|
|
|
+use biz\stat\services\StatIncomeSourceMonthService;
|
|
|
+use biz\stat\services\StatIncomeSourceService;
|
|
|
+use biz\stat\services\StatOrderMonthService;
|
|
|
+use biz\stat\services\StatOrderService;
|
|
|
use biz\user\services\UserAssetService;
|
|
|
use biz\user\services\UserCapitalService;
|
|
|
use biz\user\services\UserGrowthService;
|
|
|
@@ -826,7 +832,52 @@ ALTER TABLE `xhMerchantCapital` MODIFY `io` TINYINT NOT NULL DEFAULT 0 COMMENT '
|
|
|
}
|
|
|
$sql = "ALTER TABLE `xhUserGrowth` MODIFY `relateId` INT NOT NULL DEFAULT 0 COMMENT '关联id';";
|
|
|
Yii::$app->db->createCommand($sql)->execute();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ //统计相关
|
|
|
+ //xhStatIncomeMonth
|
|
|
+ $list = StatIncomeMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatIncomeMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatIncomeSourceMonth
|
|
|
+ $list = StatIncomeSourceMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatIncomeSourceMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatOrder
|
|
|
+ $list = StatOrderService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $id = $val['id'];
|
|
|
+ $date = date("Ymd", $val['time']);
|
|
|
+ StatOrderService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatOrderMonth
|
|
|
+ $list = StatOrderMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatOrderMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ($num == 2) {
|
|
|
$this->actionInit2();
|
|
|
}
|
|
|
@@ -926,11 +977,58 @@ ALTER TABLE `xhMerchantCapital` MODIFY `io` TINYINT NOT NULL DEFAULT 0 COMMENT '
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//重新拉取并保存国兰客户的头像和图片 shish 2020.1.12
|
|
|
public function actionSyncAvatar()
|
|
|
{
|
|
|
+
|
|
|
+ //统计相关
|
|
|
+ //xhStatIncomeMonth
|
|
|
+ $list = StatIncomeMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatIncomeMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatIncomeSourceMonth
|
|
|
+ $list = StatIncomeSourceMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatIncomeSourceMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatOrder
|
|
|
+ $list = StatOrderService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $id = $val['id'];
|
|
|
+ $date = date("Ymd", $val['time']);
|
|
|
+ StatOrderService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //xhStatOrderMonth
|
|
|
+ $list = StatOrderMonthService::getAllByCondition([], null, '*');
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $val) {
|
|
|
+ $year = $val['year'];
|
|
|
+ $month = $val['month'];
|
|
|
+ $date = date("Ym", strtotime($year . '-' . $month . '-' . '1'));
|
|
|
+ $id = $val['id'];
|
|
|
+ StatOrderMonthService::updateById($id, ['time' => $date]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ die;
|
|
|
+
|
|
|
UserService::syncAvatar(12358);
|
|
|
}
|
|
|
|