You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.5 KiB

  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Service\v3\Interfaces\ShopCartServiceInterface;
  4. class ShopCartService implements ShopCartServiceInterface
  5. {
  6. public function do()
  7. {
  8. $res = [
  9. [
  10. 'store_nmae' => '五金杂货铺',
  11. 'price' => '100.00',
  12. 'note' => '多放辣椒',
  13. 'store_id' => 66,
  14. 'goods_list' =>
  15. [
  16. [
  17. 'id' => 3971,
  18. 'goods_id' => 1301,
  19. 'name' => '半边手撕鸡',
  20. 'num' => 4,
  21. 'price' => '90.00',
  22. 'total' => '360.00'
  23. ]
  24. ]
  25. ],
  26. [
  27. 'store_nmae' => '回味手撕鸡J009',
  28. 'note' => '手撕鸡加辣',
  29. 'store_price' => '720.00',
  30. 'store_id' => 123,
  31. 'goods_list' =>
  32. [
  33. [
  34. 'id' => 3971,
  35. 'goods_id' => 1301,
  36. 'name' => '半边手撕鸡',
  37. 'num' => 4,
  38. 'price' => '90.00',
  39. 'total' => '360.00'
  40. ],
  41. [
  42. 'id' => 3971,
  43. 'goods_id' => 1301,
  44. 'name' => '半边手撕鸡',
  45. 'num' => 4,
  46. 'price' => '90.00',
  47. 'total' => '360.00'
  48. ]
  49. ]
  50. ],
  51. ];
  52. return $res;
  53. }
  54. public function check()
  55. {
  56. return mt_rand(0,6);
  57. }
  58. public function undo()
  59. {
  60. $res = [
  61. [
  62. 'store_nmae' => '五金杂货铺',
  63. 'price' => '100.00',
  64. 'note' => '多放辣椒',
  65. 'store_id' => 66,
  66. 'goods_list' =>
  67. [
  68. [
  69. 'id' => 3971,
  70. 'goods_id' => 1301,
  71. 'name' => '半边手撕鸡',
  72. 'num' => 4,
  73. 'price' => '90.00',
  74. 'total' => '360.00'
  75. ]
  76. ]
  77. ],
  78. [
  79. 'store_nmae' => '回味手撕鸡J009',
  80. 'note' => '手撕鸡加辣',
  81. 'store_price' => '720.00',
  82. 'store_id' => 123,
  83. 'goods_list' =>
  84. [
  85. [
  86. 'id' => 3971,
  87. 'goods_id' => 1301,
  88. 'name' => '半边手撕鸡',
  89. 'num' => 4,
  90. 'price' => '90.00',
  91. 'total' => '360.00'
  92. ],
  93. [
  94. 'id' => 3971,
  95. 'goods_id' => 1301,
  96. 'name' => '半边手撕鸡',
  97. 'num' => 4,
  98. 'price' => '90.00',
  99. 'total' => '360.00'
  100. ]
  101. ]
  102. ],
  103. ];
  104. return $res;
  105. }
  106. public function countGoods()
  107. {
  108. return mt_rand(1,100);
  109. }
  110. }