get('p_sources'); } public static function tableName() { return '{{%coin_app_cate}}'; } public static function getAppIdByCateId($cate_id) { return self::find()->where(['cate_id' => $cate_id])->asArray()->all(); } public static function getAppCountByCateId($cate_id) { return self::find()->where(['cate_id' => $cate_id])->count(); } public static function getAppCountByCateIds($cate_ids) { $data = self::find()->select('cate_id,count(*) as num')->where(['in','cate_id',$cate_ids])->groupBy('cate_id')->asArray()->all(); return array_column($data,'num','cate_id'); } public static function getAppCate($category_id,$app_id) { return self::find()->where(['cate_id' => $category_id,'app_id' => $app_id])->one(); } public static function getCateCountByAppId($app_id) { return self::find()->where(['app_id' => $app_id])->count(); } }