|
@@ -9,7 +9,7 @@ use Dever;
|
|
class Pay
|
|
class Pay
|
|
{
|
|
{
|
|
# 发起支付
|
|
# 发起支付
|
|
- public function action($parent_uid, $uid, $id, $sku, $num, $address_id, $source, $type = false, $type_id = false)
|
|
|
|
|
|
+ public function action($parent_uid, $uid, $id, $sku, $num, $address_id, $system_source, $type = false, $type_id = false)
|
|
{
|
|
{
|
|
if (!$uid) {
|
|
if (!$uid) {
|
|
Dever::alert('错误的用户信息');
|
|
Dever::alert('错误的用户信息');
|
|
@@ -17,8 +17,6 @@ class Pay
|
|
|
|
|
|
$goods = Dever::load('goods/lib/info')->getPayInfo($id, $sku);
|
|
$goods = Dever::load('goods/lib/info')->getPayInfo($id, $sku);
|
|
$shop = Dever::db('goods/shop')->one($goods['shop_id']);
|
|
$shop = Dever::db('goods/shop')->one($goods['shop_id']);
|
|
-
|
|
|
|
- $user = Dever::db('passport/user')->one($uid);
|
|
|
|
|
|
|
|
if ($parent_uid) {
|
|
if ($parent_uid) {
|
|
$order_data['parent_uid'] = $parent_uid;
|
|
$order_data['parent_uid'] = $parent_uid;
|
|
@@ -33,7 +31,7 @@ class Pay
|
|
$order_data['name'] = $goods['name'];
|
|
$order_data['name'] = $goods['name'];
|
|
$order_data['cash'] = $goods['price'];
|
|
$order_data['cash'] = $goods['price'];
|
|
$order_data['num'] = $num;
|
|
$order_data['num'] = $num;
|
|
- $order_data['source'] = $source;
|
|
|
|
|
|
+ $order_data['system_source'] = $system_source;
|
|
$order_data['order_id'] = $this->getOrderId();
|
|
$order_data['order_id'] = $this->getOrderId();
|
|
$id = Dever::db('goods/order')->insert($order_data);
|
|
$id = Dever::db('goods/order')->insert($order_data);
|
|
|
|
|
|
@@ -41,20 +39,16 @@ class Pay
|
|
Dever::alert('支付失败');
|
|
Dever::alert('支付失败');
|
|
}
|
|
}
|
|
|
|
|
|
- $refer = 'test';
|
|
|
|
-
|
|
|
|
$param = array
|
|
$param = array
|
|
(
|
|
(
|
|
'project_id' => 1,
|
|
'project_id' => 1,
|
|
'channel_id' => $shop['channel_id'],
|
|
'channel_id' => $shop['channel_id'],
|
|
- 'system_source' => $source,
|
|
|
|
|
|
+ 'system_source' => $system_source,
|
|
'uid' => $uid,
|
|
'uid' => $uid,
|
|
- 'username' => $user['username'],
|
|
|
|
'name' => $order_data['name'],
|
|
'name' => $order_data['name'],
|
|
'cash' => $order_data['cash'] * $order_data['num'],
|
|
'cash' => $order_data['cash'] * $order_data['num'],
|
|
'product_id' => $goods['id'],
|
|
'product_id' => $goods['id'],
|
|
'order_id' => $order_data['order_id'],
|
|
'order_id' => $order_data['order_id'],
|
|
- 'refer' => $refer
|
|
|
|
);
|
|
);
|
|
|
|
|
|
$receipt = Dever::input('receipt');
|
|
$receipt = Dever::input('receipt');
|