前言
关于好多人搭建然后出现好多问题,排查后是好多二开系统,然后里面的接口小部分全部更改了,废话不多说了,上教程
教程
前往29源站的
case 'up':
$oid=daddslashes($_POST['id']);
$row=$DB->get_row("select hid from qingka_wangke_order where oid='{$oid}' ");
if($row['hid']=='ximeng'){
exit('{"code":-2,"msg":"当前订单接口异常,请去查询补单","url":""}');
}elseif($row['dockstatus']=='99'){
$result=pre_zy($oid);
exit(json_encode($result));
}
$result=processCx($oid);
for($i=0;$i<count($result);$i++){
$a=$DB->query("update qingka_wangke_order set `yid`='{$result[$i]['yid']}',`status`='{$result[$i]['status_text']}',`courseStartTime`='{$result[$i]['kcks']}',`courseEndTime`='{$result[$i]['kcjs']}',`examStartTime`='{$result[$i]['ksks']}',`name`='{$result[$i]['name']}',`examEndTime`='{$result[$i]['ksjs']}',`process`='{$result[$i]['process']}',`remarks`='{$result[$i]['remarks']}' where `user`='{$result[$i]['user']}' and `pass`='{$result[$i]['pass']}' and `kcname`='{$result[$i]['kcname']}' and `oid`='{$oid}'");
}
exit('{"code":1,"msg":"同步成功,请重新查询信息"}');
break;
case 'up':
$oid=daddslashes($_POST['id']);
$user=daddslashes($_POST['user']);
$row=$DB->get_row("select * from qingka_wangke_order where oid='$oid'");
if ($row['user'] != $user){
exit('{"code":-1,"msg":"不是你的单子你同步个几把"}');
}
if($row['hid']=='ximeng'){
exit('{"code":-2,"msg":"当前订单接口异常,请去查询补单","url":""}');
}elseif($row['dockstatus']=='99'){
//$result=pre_zy($oid);
//exit(json_encode($result));
jsonReturn(1,'实时进度,无需更新');
}
$result=processCx($oid);
for($i=0;$i<count($result);$i++){
$DB->query("update qingka_wangke_order set `name`='{$result[$i]['name']}',`yid`='{$result[$i]['yid']}',`status`='{$result[$i]['status_text']}',`courseStartTime`='{$result[$i]['kcks']}',`courseEndTime`='{$result[$i]['kcjs']}',`examStartTime`='{$result[$i]['ksks']}',`examEndTime`='{$result[$i]['ksjs']}',`process`='{$result[$i]['process']}',`remarks`='{$result[$i]['remarks']}' where `user`='{$result[$i]['user']}' and `kcname`='{$result[$i]['kcname']}' and `oid`='{$oid}'");
}
exit('{"code":1,"msg":"同步成功"}');
break;
// case 'getclass':
// $a=$DB->query("select * from qingka_wangke_class where status=1 ");
// while($row=$DB->fetch($a)){
// $data[]=array(
// 'cid'=>$row['cid'],
// 'name'=>$row['name'],
// 'price'=>$row['price'],
// 'content'=>$row['content'],
// 'sort' => $row['sort']
// );
// }
// $data=array('code'=>1,'data'=>$data);
// exit(json_encode($data));
// break;
case 'getclass':
$uid = trim(strip_tags(daddslashes($_POST['uid'])));
$key = trim(strip_tags(daddslashes($_POST['key'])));
$fenlei = trim(strip_tags(daddslashes($_POST['fenlei'])));
if ($uid == '' || $key == '') {
exit('{"code":0,"msg":"所有项目不能为空"}');
}
$userrow = $DB->get_row("select * from qingka_wangke_user where uid='$uid' limit 1");
if ($userrow['key'] == '0') {
$result = array("code" => -1, "msg" => "你还没有开通接口哦");
exit(json_encode($result));
} elseif ($userrow['key'] != $key) {
$result = array("code" => -2, "msg" => "密匙错误");
exit(json_encode($result));
}
if ($fenlei!='') {
$sql="and fenlei={$fenlei}";
}
if ($_REQUEST['cid']) {
$a = $DB->query("select * from qingka_wangke_class where status=1 and cid = '{$_REQUEST['cid']}' {$sql} order by sort desc");
} else {
$a = $DB->query("select * from qingka_wangke_class where status=1 {$sql} order by sort desc");
}
while ($row = $DB->fetch($a)) {
if ($row['yunsuan'] == "*") {
$price = round($row['price'] * $userrow['addprice'], 2);
$price1 = $price;
} elseif ($row['yunsuan'] == "+") {
$price = round($row['price'] + $userrow['addprice'], 2);
$price1 = $price;
} else {
$price = round($row['price'] * $userrow['addprice'], 2);
$price1 = $price;
}
//密价
$mijia=$DB->get_row("select * from qingka_wangke_mijia where uid='{$userrow['uid']}' and cid='{$row['cid']}' ");
if($mijia){
if ($mijia['mode']==0) {
$price=round($price-$mijia['price'],2);
if ($price<=0) {
$price=0;
}
}elseif ($mijia['mode']==1) {
$price=round(($row['price']-$mijia['price'])*$userrow['addprice'],2);
if ($price<=0) {
$price=0;
}
}elseif ($mijia['mode']==2) {
$price=$mijia['price'];
if ($price<=0) {
$price=0;
}
}
$row['name']="{$row['name']}";
}
//全站一个价
if($row['suo']!=0){
$price=$row['suo'];
}
$data[] = array(
'sort' => $row['sort'],
'cid' => $row['cid'],
'kcid' => $row['nokcid'],
'name' => $row['name'],
// 'noun' => $row['noun'],
'price' => "{$price}",
'content' => $row['content'],
'status' => $row['status'],
'fenlei' => $row['fenlei'],
);
}
foreach ($data as $key => $row) {
$sort[$key] = $row['sort'];
$cid[$key] = $row['cid'];
$name[$key] = $row['name'];
//$noun[$key] = $row['noun'];
$price[$key] = $row['price'];
$content[$key] = $row['content'];
$status[$key] = $row['status'];
}
array_multisort($sort, SORT_ASC, $cid, SORT_DESC, $data);
$data = array('code' => 1, 'data' => $data);
exit(json_encode($data));
break;
case 'zt'://暂停订单
$uid=daddslashes($_POST['uid']);
$key=trim(strip_tags(daddslashes($_POST['key'])));
$row=$DB->get_row("select * from qingka_wangke_user where uid='$uid' limit 1");
$oid=daddslashes($_POST['id']);
$b=$DB->get_row("select * from qingka_wangke_order where oid='{$oid}' ");
if($uid=='' || $key==''){
exit('{"code":0,"msg":"所有项目不能为空"}');
}
$c=ztWk($oid);
if($c['code']==1){
$DB->query("update qingka_wangke_order set status='已暂停',`bsnum`=bsnum+1 where oid='{$oid}' ");
wlog($row['uid'], "API暂停", "订单{$oid}已暂停", 0);
jsonReturn(1,$c['msg']);
}else{
jsonReturn(-1,$c['msg']);
}
break;
case 'xgmm'://修改密码
$key=trim(strip_tags(daddslashes($_POST['key'])));
$xgmm = trim(strip_tags(daddslashes($_POST['xgmm'])));
$uid=daddslashes($_POST['uid']);
$row=$DB->get_row("select * from qingka_wangke_user where uid='$uid' limit 1");
$oid=daddslashes($_POST['id']);
if (empty($xgmm)) {
jsonReturn(-1, "密码不能为空");
}
if (strlen($xgmm) < 3) {
jsonReturn(-1, "密码长度至少为3位");
}
if($uid=='' || $key==''){
exit('{"code":0,"msg":"所有项目不能为空"}');
} else {
$b = xgmm($oid,$xgmm);
if ($b['code'] == 1) {
$DB->query("UPDATE qingka_wangke_order SET pass = '{$xgmm}' WHERE oid = '{$oid}'");
$DB->query("update qingka_wangke_user set money=money-0.01 where uid='{$row['uid']}' limit 1 ");
wlog($row['uid'], "API修改密码", "订单{$oid}修改密码成功扣除0.01", -0.01);
jsonReturn(1, $b['msg']);
} else {
jsonReturn(-1, $b['msg']);
}
}
break;
case 'ms_order'://列表提交秒刷
$key=trim(strip_tags(daddslashes($_POST['key'])));
$oid=daddslashes($_POST['id']);
$b = $DB->get_row("select cid,dockstatus from qingka_wangke_order where oid='{$oid}' ");
$uid=daddslashes($_POST['uid']);
$row=$DB->get_row("select * from qingka_wangke_user where uid='$uid' limit 1");
if($uid=='' || $key==''){
exit('{"code":0,"msg":"所有项目不能为空"}');
} else {
$b = msWk($oid);
if ($b['code'] == 1) {
$DB->query("update qingka_wangke_user set money=money-0.02 where uid='{$row['uid']}' limit 1 ");
wlog($row['uid'], "API提交秒刷", "订单{$oid}提交秒刷成功扣除0.02", -0.02);
jsonReturn(1, $b['msg']);
} else {
jsonReturn(-1, $b['msg']);
}
}
break;
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容