21,886
社区成员
发帖
与我相关
我的任务
分享
if ($openId == '' && $billno == '' && $status == '0') {
$where = "`gameId` = '$gameId' and `status` = '$status'";
} else if ($openId == '' && $billno == '' && $status == '1') {
$where = "`gameId` = '$gameId' and `status` <> '0'";
} else if ($openId != '' && $billno != '' && $status == '0') {
$where = "`gameId` = '$gameId' and `status` = '$status'and billno = '$billno' and openId= '$openId'";
} else if ($openId == '' && $billno != '' && $status == '0') {
$where = "`gameId` = '$gameId' and `status` = '$status'and billno = '$billno'";
} else if ($openId == '' && $billno != '' && $status == '1') {
$where = "`gameId` = '$gameId' and `status` <> '0' and billno = '$billno'";
} else if ($openId != '' && $billno == '' && $status == '1') {
$where = "`gameId` = '$gameId' and `status` <> '0' and openId = '$openId'";
} else if ($openId != '' && $billno == '' && $status == '0') {
$where = "`gameId` = '$gameId' and `status` = '$status'and openId = '$openId'";
} else {
$where = "`gameId` = '$gameId' and `status` <> '0'and billno = '$billno' and openId= '$openId'";
}
$sql = "SELECT * FROM `codes_buy_records` WHERE $where and time BETWEEN '$starttime' and '$endtime' order by time desc";
$where = ' `gameId` = "'.$gameId.'"';
if ($status) {
$where .= ' AND `status` <> 0';
}else{
$where .= ' AND `status` = "'.$status.'"';
}
if ($openId) {
$where .= ' AND `openId` = "'.$openId.'"';
}
if ($billno) {
$where .= 'AND `billno` = "'.$billno.'"';
}
$where = '';
if ($status) {
$where .= '`status` <> 0';
}else{
$where .= '`status` = "'.$status.'"';
}
if ($openId) {
$where .= '`openId` = "'.$openId.'"';
}
if ($billno) {
$where .= '`billno` = "'.$billno.'"';
}