|
@@ -134,6 +134,7 @@ class PayRequest extends loyalsoft\Object_ext {
|
|
unset($arr['order_id']);
|
|
unset($arr['order_id']);
|
|
unset($arr['ageRange']);
|
|
unset($arr['ageRange']);
|
|
unset($arr['product_desc']);
|
|
unset($arr['product_desc']);
|
|
|
|
+ unset($arr['clientVer']);
|
|
$n = loyalsoft\daoInst()->update(self::orderTab)
|
|
$n = loyalsoft\daoInst()->update(self::orderTab)
|
|
->data($arr)
|
|
->data($arr)
|
|
->where('id')->eq($this->order_id)
|
|
->where('id')->eq($this->order_id)
|
|
@@ -205,20 +206,20 @@ class PayRequest extends loyalsoft\Object_ext {
|
|
$infoArr = array();
|
|
$infoArr = array();
|
|
\loyalsoft\CLog::pay($params);
|
|
\loyalsoft\CLog::pay($params);
|
|
$callbackInfo = $params['developerPayload'];
|
|
$callbackInfo = $params['developerPayload'];
|
|
- $infos = explode(',', $callbackInfo); # uid,zoneid,cpOrderId,productId
|
|
|
|
|
|
+ $infos = explode(',', $callbackInfo); # uid,zoneid,cpOrderId,productId
|
|
|
|
|
|
$infoArr['orderId'] = $params['orderId'];
|
|
$infoArr['orderId'] = $params['orderId'];
|
|
- $infoArr['accountId'] = $infos[0]; # uid
|
|
|
|
- $infoArr['amount'] = number_format($params['price'] / 100, 2, '.', ''); # 分转元 # 华为给过来是分, 这里先转换为元, 入库时再统一以分为单位
|
|
|
|
- $infoArr['currency'] = $params['currency']; # 如果是海外会有不同的货币类型
|
|
|
|
|
|
+ $infoArr['accountId'] = $infos[0]; # uid
|
|
|
|
+ $infoArr['amount'] = number_format($params['price'] / 100, 2, '.', ''); # 分转元 # 华为给过来是分, 这里先转换为元, 入库时再统一以分为单位
|
|
|
|
+ $infoArr['currency'] = $params['currency']; # 如果是海外会有不同的货币类型
|
|
$infoArr['product_id'] = $params['productId'];
|
|
$infoArr['product_id'] = $params['productId'];
|
|
$infoArr['product_count'] = 1;
|
|
$infoArr['product_count'] = 1;
|
|
- $infoArr['channel'] = "huawei"; # 华为
|
|
|
|
- $infoArr['zoneid'] = (int) $infos[1]; # 分区信息
|
|
|
|
|
|
+ $infoArr['channel'] = "huawei"; # 华为
|
|
|
|
+ $infoArr['zoneid'] = (int) $infos[1]; # 分区信息
|
|
$infoArr['callbackInfo'] = $callbackInfo;
|
|
$infoArr['callbackInfo'] = $callbackInfo;
|
|
|
|
|
|
$o = new payRequest($infoArr);
|
|
$o = new payRequest($infoArr);
|
|
- $o->cpOrderId = $infos[2]; # 重新修订下cpOrderId
|
|
|
|
|
|
+ $o->cpOrderId = $infos[2]; # 重新修订下cpOrderId
|
|
return $o;
|
|
return $o;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -248,13 +249,13 @@ class PayRequest extends loyalsoft\Object_ext {
|
|
exit('{"err":1,"msg":"金额不符!"}');
|
|
exit('{"err":1,"msg":"金额不符!"}');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- loyalsoft\daoInst()->insert(self::orderTab) # 创建一个新的订单
|
|
|
|
|
|
+ loyalsoft\daoInst()->insert(self::orderTab) # 创建一个新的订单
|
|
->data(array('order_ts' => loyalsoft\now()))
|
|
->data(array('order_ts' => loyalsoft\now()))
|
|
->exec();
|
|
->exec();
|
|
- $this->order_id = loyalsoft\daoInst()->select('last_insert_id() as id')->fetch('id'); # 取刚才创建的订单的自增id
|
|
|
|
- $this->cpOrderId = LoyalsoftAPPID . \date('ymdHi') . substr(sprintf("%1$06d", $this->order_id), -6); # 商户唯一id(尾部附加自增id后6位数)
|
|
|
|
- $this->callbackInfo .= "," . $this->cpOrderId; # 将cpOrderId追加到透传参数中
|
|
|
|
- $this->notifyUrl = $this::get_notify_url(); # 自动提取支付回调地址
|
|
|
|
|
|
+ $this->order_id = loyalsoft\daoInst()->select('last_insert_id() as id')->fetch('id'); # 取刚才创建的订单的自增id
|
|
|
|
+ $this->cpOrderId = LoyalsoftAPPID . \date('ymdHi') . substr(sprintf("%1$06d", $this->order_id), -6); # 商户唯一id(尾部附加自增id后6位数)
|
|
|
|
+ $this->callbackInfo .= "," . $this->cpOrderId; # 将cpOrderId追加到透传参数中
|
|
|
|
+ $this->notifyUrl = $this::get_notify_url(); # 自动提取支付回调地址
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -285,24 +286,24 @@ class PayRequest extends loyalsoft\Object_ext {
|
|
$amt = $this->amount;
|
|
$amt = $this->amount;
|
|
|
|
|
|
if (isset($uid) && isset($ageRange)) {
|
|
if (isset($uid) && isset($ageRange)) {
|
|
- $monthTS = loyalsoft\TimeUtil::tsMonthBegin(); # 本月初起始时间戳
|
|
|
|
- $dayTS = loyalsoft\TimeUtil::tsDayBegin(); # 当天起始时间戳
|
|
|
|
|
|
+ $monthTS = loyalsoft\TimeUtil::tsMonthBegin(); # 本月初起始时间戳
|
|
|
|
+ $dayTS = loyalsoft\TimeUtil::tsDayBegin(); # 当天起始时间戳
|
|
$monthTotal = loyalsoft\daoInst()
|
|
$monthTotal = loyalsoft\daoInst()
|
|
- ->select("sum(`amount`)/100 as total") # 总金额(单位:分转元)
|
|
|
|
|
|
+ ->select("sum(`amount`)/100 as total") # 总金额(单位:分转元)
|
|
->from(self::orderTab)
|
|
->from(self::orderTab)
|
|
- ->where("uid")->eq($uid) # 该玩家
|
|
|
|
- ->andWhere("status")->eq(1) # 成交订单
|
|
|
|
- ->andWhere("order_ts")->ge($monthTS) # 本月
|
|
|
|
|
|
+ ->where("uid")->eq($uid) # 该玩家
|
|
|
|
+ ->andWhere("status")->eq(1) # 成交订单
|
|
|
|
+ ->andWhere("order_ts")->ge($monthTS) # 本月
|
|
->fetch('total');
|
|
->fetch('total');
|
|
if (!is_numeric($monthTotal)) {
|
|
if (!is_numeric($monthTotal)) {
|
|
$monthTotal = 0;
|
|
$monthTotal = 0;
|
|
}
|
|
}
|
|
$dayTotal = loyalsoft\daoInst()
|
|
$dayTotal = loyalsoft\daoInst()
|
|
- ->select("sum(`amount`)/100 as total") # 总金额(单位:分转元)
|
|
|
|
|
|
+ ->select("sum(`amount`)/100 as total") # 总金额(单位:分转元)
|
|
->from(self::orderTab)
|
|
->from(self::orderTab)
|
|
- ->where("uid")->eq($uid) # 该玩家
|
|
|
|
- ->andWhere("status")->eq(1) # 成交订单
|
|
|
|
- ->andWhere("order_ts")->ge($dayTS) # 今日
|
|
|
|
|
|
+ ->where("uid")->eq($uid) # 该玩家
|
|
|
|
+ ->andWhere("status")->eq(1) # 成交订单
|
|
|
|
+ ->andWhere("order_ts")->ge($dayTS) # 今日
|
|
->fetch('total');
|
|
->fetch('total');
|
|
if (!is_numeric($dayTotal)) {
|
|
if (!is_numeric($dayTotal)) {
|
|
$dayTotal = 0;
|
|
$dayTotal = 0;
|