|
@@ -8,14 +8,12 @@ use Dever;
|
|
|
|
|
|
class Buy
|
|
|
{
|
|
|
- # 1是门店,2是仓库,3是工厂,1,2,3是查看采购人的订单,11,12,13是查看供货商的订单
|
|
|
- public $type = 1;
|
|
|
# 1是列表,2是详情
|
|
|
public $view = 1;
|
|
|
# 获取配置
|
|
|
public $config = array();
|
|
|
# table
|
|
|
- public $table = 'shop/buy_order';
|
|
|
+ public $table = 'card/order';
|
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
@@ -23,9 +21,8 @@ class Buy
|
|
|
}
|
|
|
|
|
|
# 设置订单的类型
|
|
|
- public function set($type, $view)
|
|
|
+ public function set($view)
|
|
|
{
|
|
|
- $this->type = $type;
|
|
|
$this->view = $view;
|
|
|
|
|
|
return $this;
|
|
@@ -35,19 +32,11 @@ class Buy
|
|
|
# 获取公共的where
|
|
|
public function where($id)
|
|
|
{
|
|
|
- $where = array();
|
|
|
- if ($this->type > 10) {
|
|
|
- $type = $this->type - 10;
|
|
|
- $where['source_type'] = $type;
|
|
|
- $where['source_id'] = $id;
|
|
|
- } else {
|
|
|
- $where['type'] = $this->type;
|
|
|
- $where['type_id'] = $id;
|
|
|
- }
|
|
|
-
|
|
|
- if (!$where) {
|
|
|
+ if (!$id) {
|
|
|
Dever::alert('参数错误');
|
|
|
}
|
|
|
+ $where = array();
|
|
|
+ $where['uid'] = $id;
|
|
|
|
|
|
return $where;
|
|
|
}
|
|
@@ -59,11 +48,7 @@ class Buy
|
|
|
$where = $this->where($id);
|
|
|
$status = Dever::input('status');
|
|
|
if ($status) {
|
|
|
- if ($status == 'refund') {
|
|
|
- $where['refund_status'] = 2;
|
|
|
- } else {
|
|
|
- $where['status'] = $status;
|
|
|
- }
|
|
|
+ $where['status'] = $status;
|
|
|
}
|
|
|
|
|
|
$order_num = Dever::input('order_num');
|
|
@@ -71,39 +56,18 @@ class Buy
|
|
|
$where['order_num'] = $order_num;
|
|
|
}
|
|
|
|
|
|
- $refund_status = Dever::input('refund_status');
|
|
|
- if ($refund_status) {
|
|
|
- $where['refund_status'] = $refund_status;
|
|
|
- }
|
|
|
-
|
|
|
$result['search_value'] = $where;
|
|
|
$result['search_value']['day'] = $day = Dever::input('day');
|
|
|
if ($day) {
|
|
|
- if ($this->type > 10) {
|
|
|
- $where['start_o'] = Dever::maketime($day . ' 00:00:00');
|
|
|
- $where['end_o'] = Dever::maketime($day . ' 23:59:59');
|
|
|
- } elseif ($this->type == 2) {
|
|
|
- $where['start_f'] = Dever::maketime($day . ' 00:00:00');
|
|
|
- $where['end_f'] = Dever::maketime($day . ' 23:59:59');
|
|
|
- } else {
|
|
|
- $where['start'] = Dever::maketime($day . ' 00:00:00');
|
|
|
- $where['end'] = Dever::maketime($day . ' 23:59:59');
|
|
|
- }
|
|
|
+ $where['start'] = Dever::maketime($day . ' 00:00:00');
|
|
|
+ $where['end'] = Dever::maketime($day . ' 23:59:59');
|
|
|
}
|
|
|
|
|
|
$result['search_value']['start'] = $start = Dever::input('start');
|
|
|
$result['search_value']['end'] = $end = Dever::input('end');
|
|
|
if ($start && $end) {
|
|
|
- if ($this->type > 10) {
|
|
|
- $where['start_o'] = Dever::maketime($start);
|
|
|
- $where['end_o'] = Dever::maketime($end);
|
|
|
- } elseif ($this->type == 2) {
|
|
|
- $where['start_f'] = Dever::maketime($start);
|
|
|
- $where['end_f'] = Dever::maketime($end);
|
|
|
- } else {
|
|
|
- $where['start'] = Dever::maketime($start);
|
|
|
- $where['end'] = Dever::maketime($end);
|
|
|
- }
|
|
|
+ $where['start'] = Dever::maketime($start);
|
|
|
+ $where['end'] = Dever::maketime($end);
|
|
|
}
|
|
|
|
|
|
$excel = Dever::input('excel', 1);
|
|
@@ -120,18 +84,10 @@ class Buy
|
|
|
}
|
|
|
|
|
|
$result['search'] = array();
|
|
|
- $result['search']['status'] = array
|
|
|
- (
|
|
|
- array('value' => 1, 'name' => '待支付'),
|
|
|
- array('value' => 2, 'name' => '待审核'),
|
|
|
- array('value' => 3, 'name' => '待发货'),
|
|
|
- array('value' => 4, 'name' => '待收货确认'),
|
|
|
- array('value' => 5, 'name' => '已完成'),
|
|
|
- array('value' => 6, 'name' => '已完成(有退款)'),
|
|
|
- array('value' => '7,8,11', 'name' => '已取消'),
|
|
|
- );
|
|
|
+ $result['search']['status'] = $this->config['status'];
|
|
|
|
|
|
- $result['config'] = Dever::db('main/manage_config')->find();
|
|
|
+ $config = Dever::db('main/sell_config')->find();
|
|
|
+ $result['card_name'] = $config['card'];
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
@@ -150,9 +106,10 @@ class Buy
|
|
|
|
|
|
if ($show) {
|
|
|
$result = $this->getInfo($result, true);
|
|
|
- }
|
|
|
|
|
|
- $result['config'] = Dever::db('main/manage_config')->find();
|
|
|
+ $config = Dever::db('main/sell_config')->find();
|
|
|
+ $result['card_name'] = $config['card'];
|
|
|
+ }
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
@@ -168,8 +125,8 @@ class Buy
|
|
|
if ($info['time'] >= $m) {
|
|
|
# 已过期,自动取消
|
|
|
$info['time'] = -1;
|
|
|
- Dever::db($this->table)->update(array('where_id' => $info['id'], 'status' => 11));
|
|
|
- $info['status'] = 11;
|
|
|
+ Dever::db($this->table)->update(array('where_id' => $info['id'], 'status' => 5));
|
|
|
+ $info['status'] = 5;
|
|
|
} else {
|
|
|
$info['time'] = $m - $info['time'];
|
|
|
}
|
|
@@ -177,60 +134,28 @@ class Buy
|
|
|
|
|
|
$info['status_name'] = $this->config['status'][$info['status']];
|
|
|
|
|
|
- $info['goods'] = Dever::db('shop/buy_order_goods')->select(array('order_id' => $info['id']));
|
|
|
- if ($info['type'] == 1) {
|
|
|
- $info['type_info'] = Dever::db('shop/info')->getOne($info['type_id']);
|
|
|
- } elseif ($info['type'] == 2) {
|
|
|
- $info['type_info'] = Dever::db('store/info')->find($info['type_id']);
|
|
|
- } elseif ($info['type'] == 3) {
|
|
|
- $info['type_info'] = Dever::db('factory/info')->find($info['type_id']);
|
|
|
- }
|
|
|
-
|
|
|
- if ($info['source_type'] == 1) {
|
|
|
- $info['source_info'] = Dever::db('shop/info')->getOne($info['source_id']);
|
|
|
- } elseif ($info['source_type'] == 2) {
|
|
|
- $info['source_info'] = Dever::db('store/info')->find($info['source_id']);
|
|
|
- } elseif ($info['source_type'] == 3) {
|
|
|
- $info['source_info'] = Dever::db('factory/info')->find($info['source_id']);
|
|
|
- }
|
|
|
+ $info['card'] = Dever::db('card/order_card')->select(array('order_id' => $info['id']));
|
|
|
|
|
|
$info['cdate'] = date('Y-m-d H:i', $info['cdate']);
|
|
|
- if ($info['operdate']) {
|
|
|
- $info['operdate'] = date('Y-m-d H:i', $info['operdate']);
|
|
|
- } else {
|
|
|
- $info['operdate'] = $info['cdate'];
|
|
|
- }
|
|
|
- $goods_status = Dever::db('shop/buy_order_goods')->config['status'];
|
|
|
- $goods_process = Dever::db('shop/buy_order_refund')->config['process'];
|
|
|
- if ($view || $this->view == 2) {
|
|
|
- foreach ($info['goods'] as $k => $v) {
|
|
|
- $info['goods'][$k]['info'] = Dever::load('goods/lib/info')->getPayInfo($v['goods_id'], $v['sku_id']);
|
|
|
- $info['goods'][$k]['status_name'] = $goods_status[$v['status']];
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- foreach ($info['goods'] as $k => $v) {
|
|
|
- $goods = Dever::db('goods/info')->one($v['goods_id']);
|
|
|
- $info['goods'][$k]['name'] = $goods['name'];
|
|
|
- $info['goods'][$k]['cover'] = $goods['cover'];
|
|
|
- $info['goods'][$k]['status_name'] = $goods_status[$v['status']];
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- if (!$info['refund_cash']) {
|
|
|
- $info['refund_cash'] = 0;
|
|
|
+ foreach ($info['card'] as $k => $v) {
|
|
|
+ $info['card'][$k]['info'] = Dever::db('card/info')->find($v['card_id']);
|
|
|
+ $info['card'][$k]['type'] = Dever::db('card/type')->find($info['card'][$k]['info']['type_id']);
|
|
|
}
|
|
|
|
|
|
# 配送信息
|
|
|
- $info['ps_info'] = Dever::db('shop/buy_order_ps')->find(array('order_id' => $info['id']));
|
|
|
+ $info['ps_info'] = Dever::db('card/order_ps')->find(array('order_id' => $info['id']));
|
|
|
if ($info['ps_info']) {
|
|
|
- $info['ps_info']['service_name'] = '商家自送';
|
|
|
+ $info['ps_info']['service_name'] = '平台配送';
|
|
|
$info['ps_info']['cdate'] = date('Y-m-d H:i', $info['ps_info']['cdate']);
|
|
|
- if ($info['ps_info']['ydate']) {
|
|
|
- $info['ps_info']['ydate'] = date('Y-m-d H:i', $info['ps_info']['ydate']);
|
|
|
+ if ($info['ps_info']['qu_date']) {
|
|
|
+ $info['ps_info']['qu_date'] = date('Y-m-d H:i', $info['ps_info']['qu_date']);
|
|
|
+ }
|
|
|
+ if ($info['ps_info']['qs_date']) {
|
|
|
+ $info['ps_info']['qs_date'] = date('Y-m-d H:i', $info['ps_info']['qs_date']);
|
|
|
}
|
|
|
|
|
|
- $status = Dever::db('shop/buy_order_ps')->config['status'];
|
|
|
+ $status = Dever::db('card/order_ps')->config['status'];
|
|
|
$info['ps_info']['status_name'] = $status[$info['ps_info']['status']];
|
|
|
|
|
|
if ($info['ps_info']['service_id'] > 0) {
|
|
@@ -239,98 +164,90 @@ class Buy
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if ($info['address_id']) {
|
|
|
+ $info['address'] = Dever::db('passport/address')->find($info['address_id']);
|
|
|
+ }
|
|
|
+
|
|
|
return $info;
|
|
|
}
|
|
|
|
|
|
# 发起支付
|
|
|
- public function pay($uid, $type, $type_id, $name, $num, $goods, $price, $info, $refer = '')
|
|
|
+ public function pay($user, $shop, $name, $num, $card, $oprice, $price, $cash, $address_id, $system_source = 5, $refer = '')
|
|
|
{
|
|
|
- $openid = false;
|
|
|
+ if (!$user) {
|
|
|
+ Dever::alert('错误的用户信息');
|
|
|
+ }
|
|
|
+
|
|
|
+ $uid = $user['id'];
|
|
|
+
|
|
|
if ($uid > 0) {
|
|
|
- $wechat = Dever::db('passport/wechat')->one(array('uid' => $uid, 'type' => 1, 'system_id' => 2));
|
|
|
+ $wechat = Dever::db('passport/wechat')->one(array('uid' => $uid, 'type' => 1, 'system_id' => 1));
|
|
|
|
|
|
if (!$wechat) {
|
|
|
Dever::alert('错误的用户信息');
|
|
|
}
|
|
|
-
|
|
|
- $openid = $wechat['openid'];
|
|
|
}
|
|
|
-
|
|
|
- $order_data['type'] = $type;
|
|
|
- $order_data['type_id'] = $type_id;
|
|
|
+
|
|
|
+ $order_data['shop_id'] = $shop['id'];
|
|
|
+ $order_data['uid'] = $uid;
|
|
|
+ $order_data['mobile'] = $user['mobile'];
|
|
|
+ $order_data['address_id'] = $address_id;
|
|
|
$order_data['name'] = $name;
|
|
|
$order_data['num'] = $num;
|
|
|
- $order_data['info'] = $info;
|
|
|
+ $order_data['oprice'] = $oprice;
|
|
|
$order_data['price'] = $price;
|
|
|
|
|
|
$order_data['order_num'] = $this->getOrderId();
|
|
|
- $order_data['refund_cash'] = 0;
|
|
|
- $order_data['refund_p_cash'] = 0;
|
|
|
- $id = Dever::db('shop/buy_order')->insert($order_data);
|
|
|
+ $id = Dever::db('card/order')->insert($order_data);
|
|
|
|
|
|
if (!$id) {
|
|
|
Dever::alert('支付失败');
|
|
|
}
|
|
|
|
|
|
- foreach($goods as $k => $v) {
|
|
|
+ foreach($card as $k => $v) {
|
|
|
+ $data['uid'] = $uid;
|
|
|
$data['order_id'] = $id;
|
|
|
- $data['goods_id'] = $v['id'];
|
|
|
- $data['sku_id'] = $v['sku_id'];
|
|
|
+ $data['card_id'] = $v['id'];
|
|
|
$data['price'] = $v['price'];
|
|
|
$data['num'] = $v['buy_num'];
|
|
|
|
|
|
- Dever::db('shop/buy_order_goods')->insert($data);
|
|
|
+ Dever::db('card/order_card')->insert($data);
|
|
|
}
|
|
|
|
|
|
- if ($price <= 0) {
|
|
|
-
|
|
|
- $param['pay_product_id'] = $id;
|
|
|
- $param['pay_order_id'] = $order_data['order_num'];
|
|
|
- $param['pay_status'] = 2;
|
|
|
- $param['pay_cash'] = $price;
|
|
|
- $param['pay_msg'] = '';
|
|
|
- $this->success($param);
|
|
|
- return array
|
|
|
- (
|
|
|
- 'order' => '',
|
|
|
- 'order_num' => $order_data['order_num'],
|
|
|
- 'order_id' => $id,
|
|
|
- 'type' => 'pay',
|
|
|
- );
|
|
|
- }
|
|
|
+ $sell_config = Dever::db('main/sell_config')->one();
|
|
|
|
|
|
$param = array
|
|
|
(
|
|
|
- 'project_id' => 2,
|
|
|
+ 'project_id' => 3,
|
|
|
'channel_id' => 1,
|
|
|
- 'system_source' => 5,
|
|
|
+ 'system_source' => $system_source,
|
|
|
'uid' => $uid,
|
|
|
'name' => $order_data['name'],
|
|
|
- 'openid' => $openid,
|
|
|
'cash' => $price,
|
|
|
'product_id' => $id,
|
|
|
'order_id' => $order_data['order_num'],
|
|
|
'refer' => $refer,
|
|
|
);
|
|
|
|
|
|
+ if ($uid > 0 && isset($wechat) && $wechat) {
|
|
|
+ $param['openid'] = $wechat['openid'];
|
|
|
+ }
|
|
|
+
|
|
|
$receipt = Dever::input('receipt');
|
|
|
if ($receipt) {
|
|
|
$param['receipt'] = $receipt;
|
|
|
}
|
|
|
|
|
|
$result = Dever::load('pay/api.pay', $param);
|
|
|
- //$result['type'] = 'test';
|
|
|
- //$result['order'] = '';
|
|
|
-
|
|
|
$result['order_num'] = $order_data['order_num'];
|
|
|
$result['order_id'] = $id;
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
# 再次发起支付
|
|
|
- public function raction($id, $refer = '')
|
|
|
+ public function raction($id, $system_source = 5, $refer = '')
|
|
|
{
|
|
|
- $order = Dever::db('shop/buy_order')->find($id);
|
|
|
+ $order = Dever::db('card/order')->find($id);
|
|
|
|
|
|
if (!$order) {
|
|
|
Dever::alert('订单信息错误');
|
|
@@ -342,10 +259,10 @@ class Buy
|
|
|
|
|
|
$param = array
|
|
|
(
|
|
|
- 'project_id' => 2,
|
|
|
+ 'project_id' => 3,
|
|
|
'channel_id' => 1,
|
|
|
- 'system_source' => 5,
|
|
|
- 'uid' => -1,
|
|
|
+ 'system_source' => $system_source,
|
|
|
+ 'uid' => $order['uid'],
|
|
|
'name' => $order['name'],
|
|
|
'cash' => $order['price'],
|
|
|
'product_id' => $id,
|
|
@@ -361,14 +278,13 @@ class Buy
|
|
|
$result = Dever::load('pay/api.pay', $param);
|
|
|
$result['order_num'] = $order['order_num'];
|
|
|
$result['order_id'] = $id;
|
|
|
-
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
# 查询是否支付
|
|
|
public function cpay($id, $system_source = 5, $refer = '')
|
|
|
{
|
|
|
- $order = Dever::db('shop/buy_order')->find($id);
|
|
|
+ $order = Dever::db('card/order')->find($id);
|
|
|
|
|
|
if (!$order) {
|
|
|
Dever::alert('订单信息错误');
|
|
@@ -396,7 +312,7 @@ class Buy
|
|
|
if ($info) {
|
|
|
return $info['key'];
|
|
|
}
|
|
|
- return 'shop_buy_dever_2020';
|
|
|
+ return 'card_buy_dever_2020';
|
|
|
}
|
|
|
|
|
|
# 支付成功回调 安全加密
|
|
@@ -415,14 +331,14 @@ class Buy
|
|
|
$cash = $send['pay_cash'];
|
|
|
$msg = $send['pay_msg'];
|
|
|
|
|
|
- $order = Dever::db('shop/buy_order')->one(array('id' => $product_id, 'time' => time()));
|
|
|
+ $order = Dever::db('card/order')->one(array('id' => $product_id, 'time' => time()));
|
|
|
if ($order && $order['status'] == 1 && $status == 2) {
|
|
|
$update['status'] = 2;
|
|
|
$update['where_id'] = $order['id'];
|
|
|
- Dever::db('shop/buy_order')->update($update);
|
|
|
+ Dever::db('card/order')->update($update);
|
|
|
|
|
|
- # 生成结算单
|
|
|
- Dever::load('cash/lib/order')->up($order, 1, 1);
|
|
|
+ # 生成卡号,从现有的卡池里获取,如果没有则要生成
|
|
|
+ Dever::load('card/lib/code')->assign($order['id']);
|
|
|
}
|
|
|
|
|
|
return 'ok';
|
|
@@ -431,8 +347,8 @@ class Buy
|
|
|
# 生成订单号
|
|
|
public function getOrderId()
|
|
|
{
|
|
|
- $where['order_num'] = Dever::order('C');
|
|
|
- $state = Dever::db('shop/buy_order')->one($where);
|
|
|
+ $where['order_num'] = Dever::order('D');
|
|
|
+ $state = Dever::db('card/order')->one($where);
|
|
|
if (!$state) {
|
|
|
return $where['order_num'];
|
|
|
} else {
|
|
@@ -444,13 +360,19 @@ class Buy
|
|
|
public function updatePs($order, $status = 1)
|
|
|
{
|
|
|
$where['order_id'] = $order['id'];
|
|
|
- $data = Dever::db('shop/buy_order_ps')->find($where);
|
|
|
+ $data = Dever::db('card/order_ps')->find($where);
|
|
|
|
|
|
if ($data) {
|
|
|
$update['where_id'] = $data['id'];
|
|
|
$update['status'] = $status;
|
|
|
- $update['ydate'] = time();
|
|
|
- Dever::db('shop/buy_order_ps')->update($update);
|
|
|
+ if ($status == 2) {
|
|
|
+ $update['qu_date'] = time();
|
|
|
+ }
|
|
|
+ if ($status == 3) {
|
|
|
+ $update['qs_date'] = time();
|
|
|
+ }
|
|
|
+
|
|
|
+ Dever::db('card/order_ps')->update($update);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -458,25 +380,11 @@ class Buy
|
|
|
public function finish($id, $order_id)
|
|
|
{
|
|
|
$data = $this->getView($id, $order_id, false);
|
|
|
- if ($data['status'] <= 4) {
|
|
|
- if ($data['refund_cash'] > 0) {
|
|
|
- $status = 6;
|
|
|
- } else {
|
|
|
- $status = 5;
|
|
|
- }
|
|
|
- $state = Dever::db('shop/buy_order')->update(array('where_id' => $data['id'], 'status' => $status, 'fdate' => time()));
|
|
|
+ if ($data['status'] <= 3) {
|
|
|
+ $status = 4;
|
|
|
+ $state = Dever::db('card/order')->update(array('where_id' => $data['id'], 'status' => $status, 'fdate' => time()));
|
|
|
if ($state) {
|
|
|
$this->updatePs($data, 3);
|
|
|
- # 增加库存
|
|
|
- $where['order_id'] = $data['id'];
|
|
|
- $where['status'] = 1;
|
|
|
- $goods = Dever::db('shop/buy_order_goods')->select($where);
|
|
|
- if ($goods) {
|
|
|
- Dever::load('shop/lib/goods')->oper($data, 1, 1, $goods);
|
|
|
- }
|
|
|
-
|
|
|
- # 生成结算单
|
|
|
- Dever::load('cash/lib/order')->up($data, 1, 2);
|
|
|
}
|
|
|
|
|
|
return 'ok';
|
|
@@ -490,11 +398,7 @@ class Buy
|
|
|
{
|
|
|
$data = $this->getView($id, $order_id, false);
|
|
|
if ($data['status'] == 1) {
|
|
|
- $state = Dever::db('shop/buy_order')->update(array('where_id' => $data['id'], 'status' => 7, 'operdate' => time()));
|
|
|
- # 生成结算单
|
|
|
- if ($state) {
|
|
|
- //Dever::load('cash/lib/order')->up($data, 1, 3);
|
|
|
- }
|
|
|
+ $state = Dever::db('card/order')->update(array('where_id' => $data['id'], 'status' => 5, 'operdate' => time()));
|
|
|
return 'ok';
|
|
|
} else {
|
|
|
Dever::alert('当前订单状态不允许取消');
|
|
@@ -504,74 +408,12 @@ class Buy
|
|
|
# 查看订单状态
|
|
|
public function orderStatus($id)
|
|
|
{
|
|
|
- $config = Dever::db('shop/buy_order')->config;
|
|
|
+ $config = Dever::db('card/order')->config;
|
|
|
|
|
|
- $info = Dever::db('shop/buy_order')->one($id);
|
|
|
- $tk = Dever::db('shop/buy_order_refund')->find(array('order_id' => $info['id'], 'process' => 1));
|
|
|
+ $info = Dever::db('card/order')->one($id);
|
|
|
+
|
|
|
$status = $config['status'][$info['status']];
|
|
|
|
|
|
- if ($tk) {
|
|
|
- $status = '申请退款中';
|
|
|
- }
|
|
|
return $status;
|
|
|
}
|
|
|
-
|
|
|
- # 后台审核退款
|
|
|
- public function refund_commit_api()
|
|
|
- {
|
|
|
- $id = Dever::input('id');
|
|
|
- $process = Dever::input('process');
|
|
|
- return Dever::load('shop/lib/refund')->set('buy')->action($id, $process, false);
|
|
|
- }
|
|
|
-
|
|
|
- # 货物未发出,仅退款
|
|
|
- public function refund_apply_commit_api()
|
|
|
- {
|
|
|
- $order_id = Dever::input('order_id');
|
|
|
- $type = Dever::input('type');
|
|
|
- $type_id = Dever::input('type_id');
|
|
|
- $desc = Dever::input('desc');
|
|
|
- $pic = Dever::input('pic');
|
|
|
-
|
|
|
- return Dever::load('shop/lib/refund')->set('buy')->apply($type, $type_id, $order_id, false, 3, 0, $desc, $pic, 2);
|
|
|
- }
|
|
|
-
|
|
|
- # 货物已收到 全部退款 报损 需要审核
|
|
|
- public function refund_apply_info_commit_api()
|
|
|
- {
|
|
|
- $order_id = Dever::input('order_id');
|
|
|
- $status = Dever::input('status');
|
|
|
- $desc = Dever::input('desc');
|
|
|
- $pic = Dever::input('pic');
|
|
|
- $type = Dever::input('type');
|
|
|
- $type_id = Dever::input('type_id');
|
|
|
-
|
|
|
- return Dever::load('shop/lib/refund')->set('buy')->apply($type, $type_id, $order_id, false, $status, 0, $desc, $pic, 1);
|
|
|
- }
|
|
|
-
|
|
|
- # 部分退款信息 报损
|
|
|
- public function refund_apply_info_one_info()
|
|
|
- {
|
|
|
- $order_id = Dever::input('order_id');
|
|
|
- $order_goods_id = Dever::input('order_goods_id');
|
|
|
- $type = Dever::input('type');
|
|
|
- $type_id = Dever::input('type_id');
|
|
|
-
|
|
|
- return Dever::load('shop/lib/refund')->set('buy')->getInfo($type, $type_id, $order_id, $order_goods_id);
|
|
|
- }
|
|
|
-
|
|
|
- # 部分退款 报损
|
|
|
- public function refund_apply_info_one_commit_api()
|
|
|
- {
|
|
|
- $order_id = Dever::input('order_id');
|
|
|
- $order_goods_id = Dever::input('order_goods_id');
|
|
|
- $num = Dever::input('num', 0);
|
|
|
- $status = Dever::input('status');
|
|
|
- $desc = Dever::input('desc');
|
|
|
- $pic = Dever::input('pic');
|
|
|
- $type = Dever::input('type');
|
|
|
- $type_id = Dever::input('type_id');
|
|
|
-
|
|
|
- return Dever::load('shop/lib/refund')->set('buy')->apply($type, $type_id, $order_id, $order_goods_id, $status, $num, $desc, $pic, 1);
|
|
|
- }
|
|
|
}
|