function.php
2.08 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019-08-14
* Time: 19:42
*/
function setbgcolor($ind){
if ($ind == 0) return "#fe7496";
if ($ind == 1) return "#22c7c1";
if ($ind == 2) return "#5e82e3";
if ($ind == 11) return "#22c7c1";
if ($ind == 12) return "#5e82e3";
return "";
}
function setbgbackground($ind){
if ($ind == 0) return "#ffa1b9";
if ($ind == 1) return "#59e1d2";
if ($ind == 2) return "#a3bcff";
if ($ind == 11) return "#59e1d2";
if ($ind == 12) return "#a3bcff";
return "";
}
function get_type($ind){
if ($ind == 0) return "全场通用";
if ($ind == 1) return "品牌";
if ($ind == 2) return "品类";
if ($ind == 11) return "用途";
if ($ind == 12) return "分类1";
return "";
}
function get_type_card($ind){
if ($ind == 0) return "全场通用";
if ($ind == 1) return "指定品牌";
if ($ind == 2) return "指定品类";
if ($ind == 11) return "指定用途";
if ($ind == 12) return "指定分类1";
return "";
}
function Mini_Host(){ return WEAPPAPIURL;}
/*-- 保留俩位小数 --*/
function tofix2($val){
return floor($val*100)/100;
}
function check_is_set($ind){
$iset= tpCache('basic.categoryset',I('stoid'));
if(strpos($iset,''.$ind) !== false){
return true;
}
return false;
}
function get_tj_price($market_price,$tgr){
$jt_json=$tgr['jt_json'];
$jt_json=json_decode($jt_json,true);
$price=0;
foreach ($jt_json as $k=>$v){
if($tgr['jt_ct_num']>=$v['rynum']){
$price=$v['price'];
}
}
return $market_price-$price;
}
function get_quan_list_img($img){
if(strpos($img,"http") !== false){
return $img;
}else{
return getImg($img,NOIMG);
}
}
function replay_huiche($word){
$word= str_replace("\r\n", "<BR/>", $word);
$word= str_replace("\n", "<BR/>", $word);
$word= str_replace("\r","<BR/>", $word);
return $word;
}
function str_is_has($long,$item){
if (strpos($long, $item) !== false) {
return 1;
} else {
return 0;
}
}