shish 5 anni fa
parent
commit
9c3553dcee

+ 26 - 0
app/saas/controllers/UserPastController.php

@@ -0,0 +1,26 @@
+<?php
+/**
+ * 客户历史资产 shish 2021.2.24
+ */
+
+namespace saas\controllers;
+
+use bizTy\user\classes\UserPastClass;
+use common\components\util;
+use common\components\wxUtil;
+use Yii;
+
+class UserPastController extends BaseController
+{
+
+	//获取列表 shish 2021.2.24
+	public function actionList()
+	{
+		$get = Yii::$app->request->get();
+		$sjId = $get['sjId'] ?? 0;
+		$where = ['sjId' => $sjId];
+		$list = UserPastClass::getUserList($where);
+		util::success($list);
+	}
+
+}

+ 18 - 0
biz-ty/user/classes/UserPastClass.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace bizTy\user\classes;
+
+use biz\base\classes\BaseClass;
+
+class UserPastClass extends BaseClass
+{
+	
+	public static $baseFile = '\bizTy\user\models\UserPast';
+
+	public static function getUserList($where)
+	{
+		$data = self::getList('*', $where, 'addTime DESC');
+		return $data;
+	}
+
+}

+ 15 - 0
biz-ty/user/models/UserPast.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace bizTy\user\models;
+
+use bizTy\base\models\Base;
+
+class UserPast extends Base
+{
+
+	public static function tableName()
+	{
+		return 'xhUserPast';
+	}
+
+}

+ 13 - 0
biz-ty/user/services/UserPastService.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace bizTy\user\services;
+
+use bizTy\base\services\BaseService;
+use Yii;
+
+class UserPastService extends BaseService
+{
+
+    public static $baseFile = '\bizTy\user\classes\UserPastClass';
+
+}

+ 21 - 1
sql.sql

@@ -1239,4 +1239,24 @@ ALTER TABLE xhGhsCustom CHANGE `merchantId` `sjId` INT(11) NOT NULL DEFAULT '0'
 ALTER TABLE xhGhsCustom DROP COLUMN `addTime`;
 ALTER TABLE xhGhsCustom DROP COLUMN `updateTime`;
 ALTER TABLE xhGhsCustom ADD `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间' AFTER `buyAmount`;
-ALTER TABLE xhGhsCustom ADD `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `addTime`;
+ALTER TABLE xhGhsCustom ADD `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间' AFTER `addTime`;
+
+
+将国兰的老客户导出来并存入数据库
+
+
+DROP TABLE IF EXISTS `xhUserOldData`;
+DROP TABLE IF EXISTS `xhUserPast`;
+CREATE TABLE IF NOT EXISTS `xhUserPast` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `userName` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户名',
+  `mobile` VARCHAR(15) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '手机号',
+  `integral` INT(11) NOT NULL DEFAULT '0' COMMENT '积分数',
+  `balance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
+  `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '1未同步 2已同步',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) COMMENT='客户历史';
+ALTER TABLE xhUserPast CHANGE `integral` growth INT(11) NOT NULL DEFAULT '0' COMMENT '成长值';