<?phpglobal$_W,$_GPC;$action=$_GPC['op'];$bi=0.9;//账号类型(必选)$zhangtype_list=pdo_fetchall("SELECT * FROM ".tablename('xiaoka_xiaoshuo_zhangtype'));//所属分站(必选)$_webname_list=pdo_fetchall("SELECT * FROM ".tablename('xiaoka_xiaoshuo_webname'));//账号渠道(必选)$channel_list=pdo_fetchall("SELECT * FROM ".tablename('xiaoka_xiaoshuo_channel'));if($action=='delete'){$logId=$_GPC['id'];$uniacid=$_GPC['uniacid'];$optionId=$logId;if($logId>0){pdo_delete("kf_tpl_msg_options",array('id'=>$logId));pdo_delete("kf_tpl_msg_thread_cache",array('option_id'=>$logId));}}if($action=='add'||$action=='edit'){//添加if(checksubmit('submit')){$id=$_GPC['id'];$data=array('gname'=>$_GPC['gname'],'type'=>$_GPC['type'],'web_id'=>$_GPC['web_id'],'channel'=>$_GPC['channel'],'spend'=>$_GPC['spend'],'handover_time'=>strtotime($_GPC['handover_time']),'sim_fans_price'=>$_GPC['sim_fans_price'],'init_fans_num'=>$_GPC['init_fans_num'],'curr_recharge'=>$_GPC['curr_recharge'],'no_huiben'=>$_GPC['spend']-$_GPC['curr_recharge']*$bi,'total_huiben_rate'=>round($_GPC['curr_recharge']*$bi/$_GPC['spend'],2),'remark'=>$_GPC['remark'],'user_id'=>$_W['uid']);if(!empty($id)){pdo_update('xiaoka_xiaoshuo_zhanginfo',$data,array('id'=>$id));message('更新字段成功!',$this->createWebUrl('zhanginfo',array('op'=>'display')),'success');}else{pdo_insert('xiaoka_xiaoshuo_zhanginfo',$data);message('添加成功!',$this->createWebUrl('zhanginfo',array('op'=>'display')),'success');}die;}$poster=pdo_fetch("SELECT * FROM ".tablename('xiaoka_xiaoshuo_zhanginfo')." WHERE id = :id ",array(':id'=>$_GPC['id']));// print_r($_W);die; $_W['uid'] $_W['username']include$this->template('add_zhanginfo');die;}$condition='where 1=1';if($_GPC['authorizer_nickname']){$gname=trim($_GPC['authorizer_nickname']);$condition.=" and authorizer_nickname like '%{$gname}%'";}if(!empty($_GPC['type'])){$type=trim($_GPC['type']);$condition.=" and type like '%{$type}%'";}if(!empty($_GPC['channel'])){$channel=trim($_GPC['channel']);$condition.=" and channel like '%{$channel}%'";}if(!empty($_GPC['is_time'])){$handover_time=($_GPC['handover_time']);$starttime=$handover_time['start'];$endtime=$handover_time['end'];$ss=strtotime($starttime);$ee=strtotime($endtime);$condition.=" and unix_timestamp(search_date) between $ss and $ee";}$pageindex=max(intval($_GPC['page']),1);// 当前页码$pagesize=20;// 设置分页大小$where=" WHERE uniacid = '{$_W['uniacid']}' ";$total=pdo_fetchcolumn('SELECT COUNT(*) FROM '.tablename('xiaoshuo_custom').$condition);$sql="SELECT * FROM ".tablename("xiaoshuo_custom").$condition." order by id desc limit ".($pageindex-1)*$pagesize.",".$pagesize;$optionsList=pdo_fetchall($sql);$pager=pagination($total,$pageindex,$pagesize);//echo pdo_debug();include$this->template('customlist');//获取账号functiongetuser($type){global$_W,$_GPC;$poster=pdo_fetch("SELECT * FROM ".tablename('users')." WHERE uid = :uid ",array(':uid'=>$type));return$poster['username'];}//获取账号类型functiongetzhtype($type){global$_W,$_GPC;$poster=pdo_fetch("SELECT * FROM ".tablename('xiaoka_xiaoshuo_zhangtype')." WHERE id = :id ",array(':id'=>$type));return$poster['name'];}//获取分站名称functiongetwebid($type){global$_W,$_GPC;$poster=pdo_fetch("SELECT * FROM ".tablename('xiaoka_xiaoshuo_webname')." WHERE id = :id ",array(':id'=>$type));return$poster['name'];}//获取账号渠道functiongetzhchannel($type){global$_W,$_GPC;$poster=pdo_fetch("SELECT * FROM ".tablename('xiaoka_xiaoshuo_channel')." WHERE id = :id ",array(':id'=>$type));return$poster['name'];}
public function dowebexportlist(){
global $_W, $_GPC;
set_time_limit(0);
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=".TIMESTAMP.".xls");$exstr="ID\t昵称\t头像\topenid\t订单号\t提交时间\r";$id=($_GPC['id']);$list= pdo_fetchall("SELECT * FROM ". tablename('xiaoka_taobao_info')." WHERE rid= :rid", array(":rid"=>$id));
foreach($list as $key=>&$row){$time= date('Y-m-d H:m:s',$row['creatime']);$exstr.=$row['id'];$exstr.="\t{$row['nickname']}";$exstr.="\t{$row['headimgurl']}";$exstr.="\t{$row['openid']}";$exstr.="\t{$row['orderno']}";$exstr.="\t{$time}\r";}$exstr=iconv('UTF-8',"GB2312//IGNORE",$exstr);
exit($exstr);}