收礼处理 礼物墙
This commit is contained in:
@@ -397,6 +397,17 @@ class GiveGift extends Model
|
||||
model('api/Tasks')->tasks_complete($to_id,8);
|
||||
}
|
||||
|
||||
//使用收礼用户 和礼物ID 查询礼物墙
|
||||
$gift_wall = db::name('user_gift_wall')->where(['user_id'=>$to_id,'gift_id'=>$gid])->find();
|
||||
if($gift_wall){
|
||||
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->inc('count',$num)->update();
|
||||
$userIds = explode(',',$gift_wall['give_user_ids']);
|
||||
if(!in_array($uid,$userIds)){
|
||||
$userIds[] = $uid;
|
||||
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->update(['give_user_ids'=>implode(',',$userIds)]);
|
||||
}
|
||||
}
|
||||
|
||||
//查询收礼人和送礼人的师徒关系
|
||||
//获取系统配置的特殊礼物
|
||||
$special_gift = explode(',',get_system_config_value('master_special_gift'));
|
||||
|
||||
@@ -42,7 +42,6 @@ class WxPay
|
||||
$data ["total_fee"] = $total_fee;
|
||||
$data ["spbill_create_ip"] = $ip;
|
||||
$data ["notify_url"] = get_system_config_value("web_site")."/api/Payment/notify_wx";
|
||||
// $data ["notify_url"] = "http://vespa.qxyushen.top/api/Payment/notify_wx";
|
||||
$data ["trade_type"] = "APP";
|
||||
|
||||
$s = $this->getSign($data);
|
||||
@@ -72,25 +71,24 @@ class WxPay
|
||||
* @return $response 返回app所需字符串
|
||||
*/
|
||||
public function WxPayH5($d) {
|
||||
$host = I('server.REQUEST_SCHEME') . '://' . I('server.SERVER_NAME');
|
||||
$wxConfig = $this->config;
|
||||
$out_trade_no = $d['out_trade_no'];
|
||||
$total_fee = abs(floatval($d['total_fee'])) * 100;// 微信支付 单位为分
|
||||
$nonce_str = $this->getRandChar(32);
|
||||
|
||||
$total_fee = abs(floatval($d['money'])) * 100;// 微信支付 单位为分
|
||||
$ip = $this->get_client_ip();
|
||||
if ($ip == '::1')
|
||||
$ip = '1.1.1.1';
|
||||
$data ["appid"] = $wxConfig["app_id"];
|
||||
$data ["body"] = $d['body'];
|
||||
$data['attach'] = $d['attach'];
|
||||
$data ["mch_id"] = $wxConfig['mch_id'];
|
||||
$data ["nonce_str"] = $nonce_str;
|
||||
$data ["notify_url"] = C('BASE_URL').'api/payment/wxH5Notify';
|
||||
$data ["out_trade_no"] = $out_trade_no;
|
||||
|
||||
$data ["appid"] = \think\Env::get('wechatpay.appid');
|
||||
$data ["mch_id"] = \think\Env::get('wechatpay.mch_id');
|
||||
$data ["body"] = $d['remarke'];
|
||||
// $data['attach'] = $d['attach'];
|
||||
$data ["nonce_str"] = $this->getRandChar(32);
|
||||
|
||||
$data ["notify_url"] = get_system_config_value("web_site")."/api/Payment/notify_wx";
|
||||
$data ["out_trade_no"] = $d['order_sn'];;
|
||||
$data ["spbill_create_ip"] = $ip;
|
||||
$data ["total_fee"] = $total_fee;
|
||||
$data ["trade_type"] = "MWEB";
|
||||
$data ["time_expire"] = $d['time_expire'];
|
||||
// $data ["time_expire"] = $d['time_expire'];
|
||||
$s = $this->getSign($data);
|
||||
$data ["sign"] = $s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user