作者 lyh

GX生成白帽报表脚本

@@ -44,7 +44,8 @@ class GeoLogic extends BaseLogic @@ -44,7 +44,8 @@ class GeoLogic extends BaseLogic
44 * @time :2025/7/3 10:47 44 * @time :2025/7/3 10:47
45 */ 45 */
46 public function getType(){ 46 public function getType(){
47 - $data = $this->model->brandType(); 47 + $data['type'] = $this->model->brandType();
  48 + $data['frequency'] = $this->model->frequency;
48 $geoPlatformModel = new GeoPlatform(); 49 $geoPlatformModel = new GeoPlatform();
49 $data['platform'] = $geoPlatformModel->getList(); 50 $data['platform'] = $geoPlatformModel->getList();
50 return $this->success($data); 51 return $this->success($data);
@@ -59,6 +60,10 @@ class GeoLogic extends BaseLogic @@ -59,6 +60,10 @@ class GeoLogic extends BaseLogic
59 */ 60 */
60 public function getGeoQuestionList($map,$page,$row,$order,$field = ['*']){ 61 public function getGeoQuestionList($map,$page,$row,$order,$field = ['*']){
61 $data = $this->model->lists($map,$page,$row,$order,$field); 62 $data = $this->model->lists($map,$page,$row,$order,$field);
  63 + foreach ($data as $key => $item){
  64 + $item['type_name'] = $this->model->brandType()[$item['type']];
  65 + $data[$key] = $item;
  66 + }
62 return $this->success($data); 67 return $this->success($data);
63 } 68 }
64 69
@@ -24,7 +24,7 @@ class GeoPlatform extends Base @@ -24,7 +24,7 @@ class GeoPlatform extends Base
24 protected $table = 'gl_geo_platform'; 24 protected $table = 'gl_geo_platform';
25 25
26 const STATUS_ON = 1; 26 const STATUS_ON = 1;
27 - 27 +
28 /** 28 /**
29 * @remark :获取平台列表 29 * @remark :获取平台列表
30 * @name :getList 30 * @name :getList
@@ -23,6 +23,8 @@ class GeoQuestion extends Base @@ -23,6 +23,8 @@ class GeoQuestion extends Base
23 { 23 {
24 protected $table = 'gl_geo_question'; 24 protected $table = 'gl_geo_question';
25 25
  26 + public $frequency = [1,2,3,4,5,6,7,8,9,10];//类型
  27 +
26 /** 28 /**
27 * @remark :geo提交网址获取器 29 * @remark :geo提交网址获取器
28 * @name :getUrlAttribute 30 * @name :getUrlAttribute
@@ -76,11 +78,9 @@ class GeoQuestion extends Base @@ -76,11 +78,9 @@ class GeoQuestion extends Base
76 * @time :2025/7/3 9:43 78 * @time :2025/7/3 9:43
77 */ 79 */
78 public function brandType(){ 80 public function brandType(){
79 - $type = [ 81 + return [
80 1=>'品牌数据', 82 1=>'品牌数据',
81 2=>'营销数据' 83 2=>'营销数据'
82 ]; 84 ];
83 - $frequency = [1,2,3,4,5,6,7,8,9,10];  
84 - return ['type'=>$type,'frequency'=>$frequency];  
85 } 85 }
86 } 86 }