Commit 03e470e7 authored by zhangjun's avatar zhangjun

修改

parent 1133ec10
...@@ -2028,7 +2028,7 @@ class User extends MY_Controller ...@@ -2028,7 +2028,7 @@ class User extends MY_Controller
// 0元支付 // 0元支付
if ( $price <= 0 ) { if ( $price <= 0 ) {
//支付成功后的操作 //支付成功后的操作
$result = $this->package_model->payFinish($orderData, array('transaction_id' => '000000000000000')); $result = $this->package_model->payFinish($orderData, array('transaction_id' => $this->package_model->getPaymentTransactionId( $packageType )));
if (GB_CITY == 'nj') { if (GB_CITY == 'nj') {
$this->package_model->sendMsg( $orderData ); $this->package_model->sendMsg( $orderData );
} }
......
...@@ -58,6 +58,22 @@ class Package_model extends MY_Model ...@@ -58,6 +58,22 @@ class Package_model extends MY_Model
return time() . $formatType . $randValue; return time() . $formatType . $randValue;
} }
/**
* 获取某个产品的0元支付交易号
* @param int $type 产品类型 1代表首页推荐,2代表列表页推荐,3代表智能刷新,4代表普通刷新
* @return string
*/
public function getPaymentTransactionId($type)
{
//防止订单ID与租售宝重复,$type 定义为从50开始
$type = 50 + $type;
$formatType = self::formatValue($type, 2);
//随机数
$randValue = self::formatValue(self::randValue(), 4);
//订单号
return 'zeropay-' . time() . $formatType . $randValue;
}
/** /**
* 获取套餐详情 * 获取套餐详情
* @param int $id 套餐ID * @param int $id 套餐ID
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment