|
@@ -377,6 +377,42 @@ class Buy
|
|
|
return 'ok';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function fahuo_api()
|
|
|
+ {
|
|
|
+ $id = Dever::input('id');
|
|
|
+ $process = Dever::input('process', 3);
|
|
|
+ $info = Dever::db('shop/buy_order_tui')->find($id);
|
|
|
+
|
|
|
+ if ($info && $info['process'] == 1) {
|
|
|
+ $update['process'] = $process;
|
|
|
+ $update['where_id'] = $info['id'];
|
|
|
+ $state = Dever::db('shop/buy_order_tui')->update($update);
|
|
|
+
|
|
|
+ if ($state && $process == 2) {
|
|
|
+ $data = $this->getView($info['shop_id'], $info['order_id'], false);
|
|
|
+ if ($data) {
|
|
|
+ if ($info['order_goods_id'] > 0) {
|
|
|
+ $state = Dever::db('shop/buy_order_goods')->update(array('where_id' => $info['order_goods_id'], 'status' => 3));
|
|
|
+ $this->pay_tui($state, $data, $info['cash']);
|
|
|
+
|
|
|
+
|
|
|
+ $total = Dever::db('shop/buy_order_goods')->total(array('order_id' => $info['order_id'], 'shop_id' => $id, 'status' => 1));
|
|
|
+ if ($total <= 0) {
|
|
|
+ $state = Dever::db('shop/buy_order')->update(array('where_id' => $info['order_id'], 'status' => 8));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ $state = Dever::db('shop/buy_order')->update(array('where_id' => $info['order_id'], 'status' => 8));
|
|
|
+ $this->pay_tui($state, $data, $info['cash']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 'ok';
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function tui_action($shop_id, $order_id, $order_goods_id, $status, $price, $num = false, $desc = '', $pic = '')
|
|
|
{
|