|
@@ -789,11 +789,30 @@ function sendNotice($message)
|
|
|
|
|
|
|
|
|
* 获取隐藏cp
|
|
|
+ * @param string $package 包名/包id/站点id
|
|
|
+ * @param $type 0 是包名 ;1 是包id;2是站点id
|
|
|
* @return false|string[]
|
|
|
*/
|
|
|
-function getHiddenCp()
|
|
|
+function getHiddenCp($package = "",$type = 0)
|
|
|
{
|
|
|
- return array_filter(explode(',',env('HIDDEN_CP_SOURCE')));
|
|
|
+ if (empty($package)){
|
|
|
+ return array_filter(explode(',',env('HIDDEN_CP_SOURCE')));
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($type == 0){
|
|
|
+ $data = \DB::table('qapp_package_info')->where('package','=',$package)->value('reject_cp');
|
|
|
+ }else if($type == 1){
|
|
|
+ $data = \DB::table('qapp_package_info')->where('id','=',$package)->value('reject_cp');
|
|
|
+ }else if($type == 2) {
|
|
|
+ $data = \DB::table('qapp_package_info')->where('channel_id','=',$package)->value('reject_cp');
|
|
|
+ }else{
|
|
|
+ $data = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (empty($data)){
|
|
|
+ return array_filter(explode(',',env('HIDDEN_CP_SOURCE')));
|
|
|
+ }
|
|
|
+ return explode(',',$data);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1009,3 +1028,18 @@ if (!function_exists("get_default_public_channel_id")){
|
|
|
return config("package.default");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+if(function_exists('get_rejcet_cp_by_package_name')){
|
|
|
+ function get_rejcet_cp($package = "",$isPackageId = 0){
|
|
|
+ if (empty($package)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($isPackageId == 0){
|
|
|
+ $data = \DB::table('qapp_package_info')->where('package','=',$package)->value('cp_author_status');
|
|
|
+ }else{
|
|
|
+ $data = \DB::table('qapp_package_info')->where('id','=',$package)->value('cp_author_status');
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|