1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\dao\supplier\finance;
- use app\dao\BaseDao;
- use app\model\supplier\finance\SupplierExtract;
- class SupplierExtractDao extends BaseDao
- {
-
- protected function setModel(): string
- {
- return SupplierExtract::class;
- }
-
- public function getExtractList(array $where, string $field = '*', array $with = [], int $page = 0, int $limit = 0)
- {
- return $this->search($where)->field($field)->when($with, function ($query) use ($with) {
- $query->with($with);
- })->when($page && $limit, function ($query) use ($page, $limit) {
- $query->page($page, $limit);
- })->order('id desc')->select()->toArray();
- }
-
- public function getExtractMoneyByWhere(array $where, string $field)
- {
- return $this->search($where)->sum($field);
- }
- }
|