| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- /**
- * This is the model class for table "{{%share_holder_parent_out_log}}".
- *
- * @property integer $id
- * @property integer $parent_user_id
- * @property integer $user_id
- * @property integer $created_at
- * @property integer $updated_at
- * @property integer $old_parent_user_id
- * @property integer $store_id
- * @property string $desc
- * @property integer $type
- * @property integer $change_type
- */
- class ShareHolderParentOutLog extends \yii\db\ActiveRecord
- {
- const CHANGE_TYPE_NORMAL = 0;//普通方式绑定
- const CHANGE_TYPE_CHANGE_OLD_PARENT = 1;//滑落方式绑定
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%share_holder_parent_out_log}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
- ]
- ]
- ];
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['id', 'parent_user_id', 'user_id', 'old_parent_user_id', 'store_id', 'type', 'change_type'], 'integer'],
- [['created_at', 'updated_at'], 'safe'],
- [['desc'], 'string']
- ];
- }
-
- public static function getConditionName($condition = 0) {
- $arr = [
- 0 => '分享链接',
- 1 => '首次下单',
- 2 => '首次付款',
- 11 => '后台编辑',
- 101 => '滑落',
- ];
- return $arr[$condition] ?? '';
- }
-
- public static function getPageTypeName($page_type = 0) {
- $arr = [
- 3 => '分享首页',
- 1 => '分享商品',
- 2 => '分享海报',
- ];
- return $arr[$page_type] ?? '';
- }
- }
|