作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

修改生成海报二维码

... ... @@ -115,7 +115,7 @@ class Pay extends Api
//支付成功,更新订单状态
$status = $this->order_status;
$orderModel = new Order();
$orderModel->where(['pay_order_sn'=>$message['out_trade_no']])->update(['status'=>$status[1]]);
$orderModel->where(['pay_order_sn'=>$message['out_trade_no'],'status'=>$status[0]])->update(['status'=>$status[1]]);
}elseif($message['result_code'] === 'FAIL') {
//支付失败
}
... ... @@ -223,7 +223,7 @@ class Pay extends Api
//支付成功
$status = $this->order_status;
$orderModel = new Order();
$orderModel->where(['pay_order_sn'=>$message['out_trade_no']])->update(['status'=>$status[1]]);
$orderModel->where(['pay_order_sn'=>$message['out_trade_no'],'status'=>$status[0]])->update(['status'=>$status[1]]);
}elseif($message['result_code'] === 'FAIL') {
//支付失败,好像有问题
}
... ...
... ... @@ -135,18 +135,28 @@ class User extends Api
* @ApiSummary (获取二维码)
* @ApiMethod (GET)
* @ApiRoute (/api/user/getWxCode)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="goods_id", type="inter", required=true, description="商品id")
*
* @ApiReturn ({
"code": 1,
"msg": "成功",
"time": "1572602867",
"data": {
"code_url": "http://hotel.w.brotop.cnwx_code_img/code_6.jpg"//二维码路径
"code_url": "http://feifangu.w.brotop.cn/wx_code_img/code_6.jpg"//二维码路径
}
})
*/
public function getWxCode(){
if($this->request->isGet()){
$goods_id = $this->request->post('goods_id');
$rule = config('verify.goods_detail');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['goods_id'=>$goods_id])) {
$this->error($validate->getError());
}
//获取access_token
$config = config('verify.raw');
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$config['app_id'].'&secret='.$config['secret'];
... ... @@ -160,14 +170,14 @@ class User extends Api
//获取二维码链接
$get_code_url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='.$access_token;
$data = [
'scene' => 'share_uid='.$this->uid,
'scene' => 'share_uid='.$this->uid.'&goods_id='.$goods_id,
'width' => 280,
// 'page' => 'pages/lixiangzhong/lixiangzhong',
];
$data = json_encode($data);
$code_res = $this->auth->http_post($get_code_url,$data);
file_put_contents('wx_code_img/code_'.$this->uid.'.jpg',$code_res);
$code_url = config('verify.hotel_url').'/wx_code_img/code_'.$this->uid.'.jpg';
$code_url = config('verify.ffg_host').'/wx_code_img/code_'.$this->uid.'.jpg';
$this->success('成功', ['code_url'=>$code_url]);
}else{
$this->error('请求方式错误');
... ...
... ... @@ -4837,13 +4837,47 @@
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>goods_id</td>
<td>inter</td>
<td></td>
<td>商品id</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -4857,11 +4891,23 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/getWxCode" method="GET" name="form30" id="form30">
<div class="form-group">
<label class="control-label" for="goods_id">goods_id</label>
<input type="inter" class="form-control input-sm" id="goods_id" required placeholder="商品id" name="goods_id">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="30">提交</button>
... ... @@ -4899,7 +4945,7 @@
"msg": "成功",
"time": "1572602867",
"data": {
"code_url": "http://hotel.w.brotop.cnwx_code_img/code_6.jpg"//二维码路径
"code_url": "http://feifangu.w.brotop.cn/wx_code_img/code_6.jpg"//二维码路径
}
}</pre>
</div>
... ... @@ -5522,7 +5568,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-12-04 16:06:18 </div>
Generated on 2019-12-04 16:13:54 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...