SystemVerifyOrder.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\v1\merchant;
  12. use app\controller\admin\AuthController;
  13. use app\services\order\StoreOrderServices;
  14. use app\services\user\UserServices;
  15. use think\facade\App;
  16. /**
  17. * 核销订单
  18. * Class SystemVerifyOrder
  19. * @package app\controller\admin\v1\merchant
  20. */
  21. class SystemVerifyOrder extends AuthController
  22. {
  23. /**
  24. * 构造方法
  25. * SystemVerifyOrder constructor.
  26. * @param App $app
  27. * @param StoreOrderServices $services
  28. */
  29. public function __construct(App $app, StoreOrderServices $services)
  30. {
  31. parent::__construct($app);
  32. $this->services = $services;
  33. }
  34. /**
  35. * 获取核销订单列表
  36. * return json
  37. */
  38. public function list()
  39. {
  40. $where = $this->request->getMore([
  41. ['data', '', '', 'time'],
  42. ['real_name', ''],
  43. ['store_id', ''],
  44. ['type', ''],
  45. ['field_key', ''],
  46. ]);
  47. $data = $this->services->getOrderList($where + ['status' => 6], ['*'], ['store', 'staff']);
  48. return $this->success(['count' => $data['count'], 'data' => $data['data'], 'badge' => $data['stat']]);
  49. }
  50. /**
  51. * 未使用,获取核销订单头部
  52. * @return mixed
  53. */
  54. public function getVerifyBadge()
  55. {
  56. return $this->success([]);
  57. }
  58. /**
  59. * 订单列表推荐人详细
  60. * @param $uid
  61. * @return mixed
  62. * @throws \think\db\exception\DataNotFoundException
  63. * @throws \think\db\exception\DbException
  64. * @throws \think\db\exception\ModelNotFoundException
  65. */
  66. public function order_spread_user($uid)
  67. {
  68. /** @var UserServices $userServices */
  69. $userServices = app()->make(UserServices::class);
  70. $userInfo = $userServices->getUserInfo((int)$uid);
  71. $spread = [];
  72. if ($userInfo['spread_uid']) {
  73. $spread = $userServices->getUserInfo((int)$userInfo['spread_uid']);
  74. if ($spread) {
  75. $spread = $spread->toArray();
  76. $spread['brokerage_pric'] = $spread['brokerage_price'];
  77. $spread['birthday'] = $spread['birthday'] ? date('Y-m-d', $spread['birthday']) : '';
  78. $spread['last_time'] = $spread['last_time'] ? date('Y-m-d H:i:s', $spread['last_time']) : '';
  79. }
  80. }
  81. return $this->success(['spread' => $spread]);
  82. }
  83. }