OrderService.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace addons\WechatVideoShop\common\service;
  3. use addons\WechatVideoShop\common\models\WechatVideoShopGoods;
  4. use addons\WechatVideoShop\common\models\WechatVideoShopOrder;
  5. use common\enums\StatusEnum;
  6. use common\traits\ErrorTrait;
  7. class OrderService
  8. {
  9. use ErrorTrait;
  10. public function getOrderList($mall_id, $param)
  11. {
  12. try {
  13. $params['where'] = [
  14. ['mall_id' => $mall_id],
  15. ['status' => [StatusEnum::DISABLED, StatusEnum::ENABLED]]
  16. ];
  17. $params['limit'] = $param['limit'] ?? 15;
  18. $params['page'] = $param['page'] ?? 1;
  19. $list = WechatVideoShopOrder::listPage($params);
  20. if ($list === false) throw new \Exception(WechatVideoShopOrder::getStaticError());
  21. foreach ($list['list'] as &$val) {
  22. }
  23. unset($val);
  24. return $list;
  25. } catch (\Exception $e) {
  26. $this->setError($e->getMessage());
  27. return false;
  28. }
  29. }
  30. }