-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanner.php
52 lines (42 loc) · 1.65 KB
/
banner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* banner区资源列表获取接口
*
* $type : 资源类型
*
*/
require_once 'tasks/CoolShow/CoolShowSearch.class.php';
require_once 'configs/config.php';
require_once 'public/public.php';
$nCoolType = (int)(isset($_GET['type'])?$_GET['type']:4);
$bAlbum = (int)(isset($_GET['album'])?$_GET['album']:0);
$protocolCode = (int)(isset($_GET['protocolCode'])?$_GET['protocolCode']:1);
$nNum = (int)(isset($_GET['reqNum'])?$_GET['reqNum']:20);
$nPage = (int)(isset($_GET['page'])?$_GET['page']:0);
$nStart = $nPage * $nNum;
$coolshow = new CoolShowSearch();
if(isset($_POST['statis'])){
$json_param = isset($_POST['statis'])?$_POST['statis']:'';
$json_param = stripslashes($json_param);
$arr_param = json_decode($json_param, true);
$protocolCode = (int)(isset($arr_param['protocolCode'])?$arr_param['protocolCode']:0);
$strProduct = isset($arr_param['product'])?$arr_param['product']:'';
}
/**
* 以下函数为COOLUI5.5的banner区自运营资源和COOLUI6.0改成了专辑做了区别,
* 逻辑一样,为了统一主题/锁屏等此处未动,COOLUI6.0单独做了个函数
* 以protocolCode >=2为分界线,但是方便运营最终还是需要合并,后期看提供的资源的兼容性考虑代码合一
*
*/
if ($nCoolType == COOLXIU_TYPE_SINGLE_WALLPAPER) {
$nCoolType = COOLXIU_TYPE_ANDROIDESK_WALLPAPER;
}
if($protocolCode >= 2){
$json_result = $coolshow->getBannerList($nCoolType, $bAlbum, $nStart, $nNum, $protocolCode, $strProduct);
}else{
$json_result = $coolshow->getBanner($nCoolType);
}
echo $json_result;
require_once 'tasks/Records/RecordTask.class.php';
$rt = new RecordTask();
$rt->saveBanner($nCoolType);