get('p_sources'); } public static function tableName() { return '{{%coin_applicate_rank}}'; } public function getApplication() { return $this->hasOne(CoinApplication::class, ['id' => 'relate_id']); } public static function getApplicateList($type) { $applicate_rank_model = self::find(); $data = $applicate_rank_model->JoinWith(['application'], false) ->select('relate_id as id,sort,name,'.self::tableName().".type") ->orderBy(self::tableName().'.sort asc')->where([self::tableName().'.type' => $type])->asArray()->all(); return $data; } public static function getApplicate($relate_id,$type) { return self::find()->where(['relate_id' => $relate_id,'type' => $type])->one(); } public static function getAppList($type) { $applicate_rank_model = self::find(); $data = $applicate_rank_model->JoinWith(['application'], false) ->select('relate_id as id,sort,name,icon,advertise,'.self::tableName().".type") ->orderBy(self::tableName().'.sort asc')->where([self::tableName().'.type' => $type])->asArray()->all(); return $data; } }