PurchaseController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\ghs\classes\GhsClass;
  4. use bizGhs\order\classes\PurchaseOrderClass;
  5. use bizGhs\order\services\PurchaseOrderService;
  6. use common\components\dateUtil;
  7. use common\components\util;
  8. use Yii;
  9. class PurchaseController extends BaseController
  10. {
  11. //待结款明细 ssh 2021.1.26
  12. public function actionDebtList()
  13. {
  14. $get = Yii::$app->request->get();
  15. $id = $get['id'] ?? 0;
  16. $confirm = $get['confirm'] ?? -1;
  17. $shortOrderSn = $get['shortOrderSn'] ?? '';
  18. $info = GhsClass::getGhsInfo($id);
  19. GhsClass::valid($info, $this->shopId);
  20. $where = ['ghsId' => $id, 'debt' => PurchaseOrderClass::DEBT_YES];
  21. if ($confirm > -1) {
  22. $where['confirm'] = $confirm;
  23. }
  24. $searchTime = $get['searchTime'] ?? '';
  25. if (!empty($searchTime)) {
  26. $startTime = $get['startTime'] ?? '';
  27. $endTime = $get['endTime'] ?? '';
  28. $period = dateUtil::formatTime($searchTime, $startTime, $endTime);
  29. $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]];
  30. }
  31. if (!empty($shortOrderSn)) {
  32. $where['orderSn'] = ['like', $shortOrderSn];
  33. }
  34. $respond = PurchaseOrderService::getDebtList($where);
  35. $respond['ghsInfo'] = $info;
  36. util::success($respond);
  37. }
  38. //批量确认 ssh 20240518
  39. public function actionBatchConfirm()
  40. {
  41. util::complete('确认成功');
  42. }
  43. }