Browse Source

成长值底层文件修改

shish 6 years ago
parent
commit
3351af9cda

+ 13 - 0
common/models/xhUserGrowth.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace common\models;
+
+class xhUserGrowth extends xhBaseModel
+{
+
+    public static function tableName()
+    {
+        return 'xhUserGrowth';
+    }
+
+}

+ 0 - 80
common/models/xhUserIntegral.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-/**
- * This is the model class for table "xhUserIntegral".
- *
- * @property int $id
- * @property int $userId
- * @property string $userName 用户名
- * @property string $alipayId 支付宝的uid
- * @property int $merchantId 商家id
- * @property string $relateId 关联id
- * @property string $amount 涉及金额
- * @property int $integral 剩余可兑换积分
- * @property int $num 积分数量
- * @property int $io 收支类型0收入 1支出
- * @property int $payWay 资金收支方式0微信1支付宝2余额3现金,具体请查看配置文件configDict payWay
- * @property int $capitalType 流水订单的类型 参考configDict capitalType
- * @property string $event 原由,事项,解释
- * @property int $operatorId 操作人,adminId
- * @property string $remark 备注
- * @property int $addTime 添加时间,时间戳格式
- * @property string $createTime 创建时间
- * @property string $updateTime
- */
-class xhUserIntegral extends xhBaseModel
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return 'xhUserIntegral';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['userId', 'merchantId', 'integral', 'num', 'io', 'payWay', 'capitalType', 'operatorId', 'addTime'], 'integer'],
-            [['amount'], 'number'],
-            [['capitalType', 'createTime'], 'required'],
-            [['createTime', 'updateTime'], 'safe'],
-            [['userName', 'alipayId'], 'string', 'max' => 50],
-            [['relateId'], 'string', 'max' => 100],
-            [['event'], 'string', 'max' => 200],
-            [['remark'], 'string', 'max' => 1000],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'id' => 'ID',
-            'userId' => 'User ID',
-            'userName' => 'User Name',
-            'alipayId' => 'Alipay ID',
-            'merchantId' => 'Merchant ID',
-            'relateId' => 'Relate ID',
-            'amount' => 'Amount',
-            'integral' => 'Integral',
-            'num' => 'Num',
-            'io' => 'Io',
-            'payWay' => 'Pay Way',
-            'capitalType' => 'Capital Type',
-            'event' => 'Event',
-            'operatorId' => 'Operator ID',
-            'remark' => 'Remark',
-            'addTime' => 'Add Time',
-            'createTime' => 'Create Time',
-            'updateTime' => 'Update Time',
-        ];
-    }
-}

+ 1 - 1
common/services/xhPayToolService.php

@@ -259,7 +259,7 @@ class xhPayToolService
 				'capitalType' => $capitalType,
 				'addTime' => $now,
 			];
-			xhUserIntegralService::add($integralData);//用户兑换型积分流水增加
+			xhUserGrowthService::add($integralData);//用户兑换型积分流水增加
 			
 			$userCapitalData = [
 				'relateId' => (string)$orderId,

+ 3 - 3
common/services/xhUserIntegralService.php → common/services/xhUserGrowthService.php

@@ -2,9 +2,9 @@
 namespace common\services;
 use common\components\configDict;
 use Yii;
-use common\models\xhUserIntegral;
+use common\models\xhUserGrowth;
 
-class xhUserIntegralService {
+class xhUserGrowthService {
 
 	public static function add($data)
 	{
@@ -13,7 +13,7 @@ class xhUserIntegralService {
 
 	public static function getById($id)
 	{
-		$integral		= xhUserIntegral::find()->where(['id' => $id])->asArray()->one();
+		$integral		= xhUserGrowth::find()->where(['id' => $id])->asArray()->one();
 		return $integral;
 	}