OrderController.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace App\Modules\Admin\Controllers\Admin;
  3. use App\Base\BaseController;
  4. use Faker\Provider\Image;
  5. class OrderController extends BaseController
  6. {
  7. public function paginate()
  8. {
  9. $data = $this->valid([
  10. "userinfo" => "",
  11. "status" => "",
  12. "page_size" => "",
  13. ]);
  14. return $this->ok([
  15. "total" => 1,
  16. "page_total" => 1,
  17. "list" => [
  18. [
  19. "id" => 1,
  20. "no" => "23456723",
  21. "goods_name" => "商品名称",
  22. "goods_sn" => "商品型号",
  23. "user_id" => 123,
  24. "email" => "[email protected]",
  25. "created_at" => "2023-05-05 15:44:14",
  26. ],
  27. ],
  28. ]);
  29. }
  30. public function store()
  31. {
  32. return $this->ok($this->mockCategory());
  33. }
  34. protected function mockCategory()
  35. {
  36. return [
  37. "id" => 1,
  38. "name" => "分类名称",
  39. "thumb" => "xx" . Image::imageUrl(),
  40. "level" => 1,
  41. "parent_id" => 1,
  42. "parent_name" => "上级名称",
  43. "child_category_count" => 1,
  44. "child_goods_count" => 1,
  45. "weight" => 1,
  46. "index_weight" => 1,
  47. "category_weight" => 1,
  48. "search_weight" => 1,
  49. ];
  50. }
  51. public function info()
  52. {
  53. return $this->ok($this->mockCategory());
  54. }
  55. public function del()
  56. {
  57. $data = $this->valid([
  58. "id" => "required",
  59. ]);
  60. return $this->ok();
  61. }
  62. }