|
|
|
@ -128,22 +128,27 @@ class CoinOrderController extends BaseController
|
|
|
|
|
$data['order_status'] = 0;
|
|
|
|
|
}else{
|
|
|
|
|
$data['pay_amount'] = $coin_num;
|
|
|
|
|
$collection_account = I("collection_account");
|
|
|
|
|
$collection_account = I("collection_account","");
|
|
|
|
|
$pay_order_number = I("pay_order_number");
|
|
|
|
|
if($collection_account==''){
|
|
|
|
|
/*if($collection_account==''){
|
|
|
|
|
$this->ajaxReturn(['status'=>0,'info'=>'请选择汇入银行','time'=>1000],"JSON");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
if($pay_order_number==''){
|
|
|
|
|
$this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON");
|
|
|
|
|
}
|
|
|
|
|
$res = $this->upload();
|
|
|
|
|
|
|
|
|
|
//$res = $this->upload();
|
|
|
|
|
$res = $this->uploadPicture();
|
|
|
|
|
if($res['status']==0){
|
|
|
|
|
$this->ajaxReturn(['status'=>0,'info'=>'请选择支付截图','time'=>1000],"JSON");
|
|
|
|
|
}
|
|
|
|
|
if($res['error']==1){
|
|
|
|
|
$this->ajaxReturn(['status'=>0,'info'=>$res['msg'],'time'=>1000],"JSON");
|
|
|
|
|
}
|
|
|
|
|
$data['collection_account'] = $collection_account;
|
|
|
|
|
$data['pay_order_number'] = $pay_order_number;
|
|
|
|
|
$data['remark'] = I("remark");
|
|
|
|
|
$data['voucher_img'] = $res['path'];
|
|
|
|
|
$data['voucher_img'] = $res['id'];
|
|
|
|
|
$data['order_status'] = 2;
|
|
|
|
|
$data['pay_way'] = 3;
|
|
|
|
|
}
|
|
|
|
@ -366,12 +371,16 @@ class CoinOrderController extends BaseController
|
|
|
|
|
return $ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function upload(){
|
|
|
|
|
header("content-type:text/html;charset=utf-8");
|
|
|
|
|
//设置时区
|
|
|
|
|
#date_default_timezone_set('PRC');
|
|
|
|
|
//获取文件名
|
|
|
|
|
$filename = $_FILES['file']['name'];
|
|
|
|
|
if(!$filename){
|
|
|
|
|
return array("error"=>1,"msg"=>"请选择支付截图");
|
|
|
|
|
}
|
|
|
|
|
//获取文件临时路径
|
|
|
|
|
$temp_name = $_FILES['file']['tmp_name'];
|
|
|
|
|
//获取大小
|
|
|
|
@ -408,6 +417,36 @@ class CoinOrderController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上传图片
|
|
|
|
|
* @author huajie <banhuajie@163.com>
|
|
|
|
|
*/
|
|
|
|
|
public function uploadPicture(){
|
|
|
|
|
/* 返回标准数据 */
|
|
|
|
|
$result = array('status' => 1, 'info' => '上传成功', 'data' => '');
|
|
|
|
|
|
|
|
|
|
/* 调用文件上传组件上传文件 */
|
|
|
|
|
$Picture = D('Picture');
|
|
|
|
|
$pic_driver = C('PICTURE_UPLOAD_DRIVER');
|
|
|
|
|
|
|
|
|
|
$info = $Picture->upload(
|
|
|
|
|
$_FILES,
|
|
|
|
|
C('PICTURE_UPLOAD'),
|
|
|
|
|
C('PICTURE_UPLOAD_DRIVER'),
|
|
|
|
|
C("UPLOAD_{$pic_driver}_CONFIG")
|
|
|
|
|
); //TODO:上传到远程服务器
|
|
|
|
|
/* 记录图片信息 */
|
|
|
|
|
if($info){
|
|
|
|
|
$result['status'] = 1;
|
|
|
|
|
$result = array_merge($info['voucher_img'], $result);
|
|
|
|
|
} else {
|
|
|
|
|
$result['status'] = 0;
|
|
|
|
|
$result['info'] = $Picture->getError();
|
|
|
|
|
}
|
|
|
|
|
ob_clean();
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function echo_pay_qrcode($trade_no,$real_amont,$pay_amount,$qrcode_url,$type='1'){
|
|
|
|
|
if($type==1){
|
|
|
|
|
$tips = '请使用支付宝扫描二维码以完成支付';
|
|
|
|
|