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.

38 lines
810 B

5 years ago
  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Constants\v3\ActivityType;
  4. use App\Model\v3\GoodsActivity;
  5. use App\Service\v3\Interfaces\ActivityServiceInterface;
  6. class ActivityService implements ActivityServiceInterface
  7. {
  8. public function do()
  9. {
  10. // TODO: Implement do() method.
  11. }
  12. public function check()
  13. {
  14. // TODO: Implement check() method.
  15. }
  16. public function undo()
  17. {
  18. // TODO: Implement undo() method.
  19. }
  20. public function allForAppletIndex($type, $marketId)
  21. {
  22. $builder = GoodsActivity::query()
  23. ->with(['store'])
  24. ->where(['type' => $type]);
  25. if ($marketId != -1) {
  26. $builder = $builder->where('market_id', $marketId);
  27. }
  28. return $builder->get()->toArray();
  29. }
  30. }