| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\librarys\shareTree\models\AbstractTreePath;
- use app\models\userTreeQuery\OldUserTreePathQuery;
- /**
- * @property int $parent_id
- * @property int $child_id
- * @property int $nearest_parent_id
- * @property int $parent_level
- * @property int $child_level
- * @property string $created_at
- */
- class OldUserTreePath extends AbstractTreePath
- {
- /**
- * @inheritDoc
- */
- public static function tableName(): string
- {
- return '{{%old_user_tree_path}}';
- }
- /**
- * @inheritdoc
- * @return OldUserTreePathQuery the active query used by this AR class.
- */
- public static function find(): OldUserTreePathQuery
- {
- return new OldUserTreePathQuery(get_called_class());
- }
- public static function findOld(): OldUserTreePathQuery
- {
- return new OldUserTreePathQuery(get_called_class());
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes);
- if($insert && $this->child_id){
- $user = User::findOne($this->child_id);
- \app\utils\Share\BonusPool::ShareHolderLevelJob($user->store_id, 0, $this->child_id);
- }
- }
- }
|