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] ?? ''; } }