Buy.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace Scm_order\Lib;
  3. use Dever;
  4. class Buy
  5. {
  6. # 获取订单信息
  7. public function info($id)
  8. {
  9. Dever::load('manage/auth.init');
  10. $info = Dever::db('scm_order/sell')->find($id);
  11. $data['order'] = array();
  12. $data['order']['订单号'] = $info['order_num'];
  13. $seller = Dever::db('scm_role/seller')->find($info['seller_id']);
  14. $data['order']['销售商'] = $seller['name'];
  15. if ($info['uid'] && $info['uid'] > 0) {
  16. $user = Dever::db('passport/api')->info($info['uid']);
  17. $data['order']['购买人'] = $user;
  18. }
  19. $data['order'] = Dever::table($data['order']);
  20. if ($info['address']) {
  21. $data['address'] = array();
  22. $info['address'] = Dever::json_encode($info['address']);
  23. if ($info['address']) {
  24. $data['address']['收件人'] = $info['address']['name'];
  25. $data['address']['手机号'] = $info['address']['mobile'];
  26. $data['address']['地址'] = $info['address']['address'];
  27. }
  28. $data['address'] = Dever::table($data['address']);
  29. }
  30. $data['cash'] = array();
  31. $data['cash']['总数量'] = $info['num'];
  32. $data['cash']['总金额'] = $info['cash'];
  33. $data['cash']['支付金额'] = $info['pay_cash'];
  34. $data['cash'] = Dever::table($data['cash']);
  35. return $data;
  36. }
  37. public function ps($id, $name, $data)
  38. {
  39. Dever::config('base')->hook = true;
  40. $order_id = Dever::param('order_id', $data);
  41. if ($order_id) {
  42. /*
  43. $info = Dever::db('scm_order/sell')->find(array('id' => $order_id));
  44. if ($info && $info['status'] < 3) {
  45. Dever::load('shop/lib/sell')->notice($info);
  46. }*/
  47. }
  48. }
  49. }