Manage.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Vip\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. public function showOrderUser($id)
  7. {
  8. $info = Dever::db('vip/order')->one($id);
  9. $table = array();
  10. $user = Dever::db('passport/user')->one($info['uid']);
  11. $table['用户名'] = $user['username'] . '('.$info['uid'].')';
  12. $table['手机号'] = $user['mobile'];
  13. $table['产品名'] = $info['name'];
  14. if ($info['type'] == 1) {
  15. $table['支付方式'] = '购买小刊';
  16. $table['支付金额'] = $info['cash'];
  17. } elseif ($info['type'] == 3) {
  18. $table['支付方式'] = '购买小刊兑换码';
  19. //$table['兑换码'] = $info['code'];
  20. $table['支付金额'] = $info['cash'];
  21. } else {
  22. $table['支付方式'] = '兑换小刊';
  23. $table['兑换码'] = $info['code'];
  24. }
  25. //$table['购买数量'] = $info['num'];
  26. if ($info['source_uid'] && $info['source_uid'] != $info['uid']) {
  27. $user = Dever::db('passport/user')->one($info['source_uid']);
  28. $table['邀请人'] = $user['username'];
  29. }
  30. return Dever::table($table);
  31. }
  32. public function showOrderStatus($id)
  33. {
  34. $info = Dever::db('vip/order')->one($id);
  35. if ($info) {
  36. if ($info['status'] == 1) {
  37. #return '*已支付';
  38. return '待支付';
  39. } elseif ($info['status'] == 2) {
  40. return '已支付';
  41. } elseif ($info['status'] == 3) {
  42. return '支付失败';
  43. } elseif ($info['status'] == 5) {
  44. $table['状态'] = '已退款';
  45. $manage = Dever::db('manage/admin')->one($info['tk_admin']);
  46. $table['备注'] = $info['tk_desc'];
  47. $table['截图'] = '<a href="'.$info['tk_pic'].'" target="_blank"><img src="'.$info['tk_pic'].'" style="width:150px" /></a>';
  48. //$table['退款时间'] = date('Y-m-d H:i:s', $info['tk_time']);
  49. $table['操作人'] = $manage['username'];
  50. return Dever::table($table);
  51. }
  52. }
  53. }
  54. }