工会web
This commit is contained in:
56
GonghuiWeb/class/yuwen.php
Normal file
56
GonghuiWeb/class/yuwen.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
class yuwen extends myPage{
|
||||
function __construct($connname=''){ //初始化操作
|
||||
$this->connname=$connname;
|
||||
}
|
||||
function yw($yw,$gid,$wid){
|
||||
for($d=1;$d<7;$d++){
|
||||
foreach($yw as $aid){
|
||||
$yws[$aid][title]=$this->getdy('title',TABLE."class","id='".$aid."'");
|
||||
$yws[$aid][]=$this->getdy("id,title,titlecolor",TABLE."content","gid=".$gid." and weekid='".$wid."' and dayid='".$d."' and lms='".$aid."'");
|
||||
}
|
||||
}
|
||||
return $yws;
|
||||
}
|
||||
/* $out_trade_no 订单
|
||||
$trade_no 支付宝交易号
|
||||
$total 价格
|
||||
$typeid=1 在线付款没有发货 2买家没有确认 3其他状态请检查 8网上支付成功 0其他手工支付成功
|
||||
$buyj 辅导站提成 新版去掉!!!
|
||||
*/
|
||||
function pays($out_trade_no,$trade_no,$total,$typeid='3',$buyj='0'){
|
||||
$save=array('order'=>$trade_no,'typeid'=>$typeid);
|
||||
$this->insert(TABLE."buy",$save);
|
||||
$data=$this->getdy("*",TABLE."buy","orders='$trade_no'");
|
||||
if($data){//修改数据
|
||||
$this->update(TABLE."buy","typeid='".$typeid."'","orders='$trade_no'");
|
||||
}else{//添加数据
|
||||
$da=explode('|',$out_trade_no);
|
||||
$user=$this->getdy("*",TABLE."member","username='".$da['1']."'");
|
||||
$save=array(
|
||||
'uid'=>$user['id'],
|
||||
'typeid'=>$typeid,
|
||||
'orders'=>$trade_no,
|
||||
'username'=>$da[1],
|
||||
'province'=>$user['province'],
|
||||
'school'=>$user['school'],
|
||||
'gid'=>$da[0],
|
||||
'cash'=>intval($total),
|
||||
'money'=>intval($total),
|
||||
'buyj'=>$buyj,
|
||||
'addtime'=>time(),
|
||||
);
|
||||
$this->insert(TABLE."buy",$save);
|
||||
//加入新
|
||||
if($user['buy']){
|
||||
$buy=$user['buy'].$da[0]."|".intval($da[0]+1)."|";
|
||||
}else{
|
||||
$buy="|".$da[0]."|".intval($da[0]+1)."|";
|
||||
}
|
||||
$this->update(TABLE."member","buy='".$buy."'","username='".$da['1']."'");
|
||||
}
|
||||
}
|
||||
function __destruct(){//释放类
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user