MerchantReconciliationDao.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author Qinii
  6. * @day 2020-06-15
  7. *
  8. *
  9. */
  10. namespace app\common\dao\store\order;
  11. use app\common\dao\BaseDao;
  12. use app\common\model\store\order\MerchantReconciliation as model;
  13. class MerchantReconciliationDao extends BaseDao
  14. {
  15. public function getModel(): string
  16. {
  17. return model::class;
  18. }
  19. public function search(array $where)
  20. {
  21. $query = ($this->getModel()::getDB())->when(isset($where['mer_id']) && $where['mer_id'] != '' ,function($query)use($where){
  22. $query->where('mer_id',$where['mer_id']);
  23. })->when(isset($where['status']) && $where['status'] != '' ,function($query)use($where){
  24. $query->where('status',$where['status']);
  25. })->when(isset($where['is_accounts']) && $where['is_accounts'] != '' ,function($query)use($where){
  26. $query->where('is_accounts',$where['is_accounts']);
  27. })->when(isset($where['date']) && $where['date'] != '' ,function($query)use($where){
  28. getModelTime($query,$where['date']);
  29. })->when(isset($where['reconciliation_id']) && $where['reconciliation_id'] != '' ,function($query)use($where){
  30. $query->where('reconciliation_id',$where['reconciliation_id']);
  31. });
  32. return $query->order('create_time DESC,status DESC');
  33. }
  34. }