OrderstatusController.php 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\index\controller;
  3. use think\exception\ValidateException;
  4. use app\model\OrderStatus;
  5. use app\model\OrderCount;
  6. use app\model\Order;
  7. class OrderstatusController extends Base
  8. {
  9. public function list()
  10. {
  11. $OrderStatus = OrderStatus::where('status', 1)
  12. ->order('id asc')
  13. ->select()
  14. ->toArray();
  15. foreach ($OrderStatus as $vo) {
  16. $data[$vo['id']] = $vo['name'];
  17. }
  18. return $this->json(['data' => $data]);
  19. }
  20. public function listname()
  21. {
  22. $ptype = input('get.ptype', '', 'serach_in');
  23. $data = OrderStatus::listname($ptype);
  24. return $this->json(['data' => $data]);
  25. }
  26. public function settings()
  27. {
  28. $OrderStatus = OrderStatus::field('id,name')
  29. ->where('status', 1)
  30. ->order('id asc')
  31. ->select()
  32. ->toArray();
  33. $data = $OrderStatus;
  34. return $this->json(['data' => $data]);
  35. }
  36. }