| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * @package merchant
- *
- * @author cabbage
- * @day 2020/11/10
- */
- namespace app\common\dao\store\order;
- use app\common\dao\BaseDao;
- use app\common\model\store\order\AgentOrder;
- class AgentOrderDao extends BaseDao
- {
- protected function getModel(): string
- {
- return AgentOrder::class;
- }
- public function insert(){
- }
- public function searchJoin(array $where)
- {
- return AgentOrder::getDB()->alias('a')->join('User b', 'a.uid = b.uid')
- ->field('a.*,b.nickname,b.account')
- ->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
- $query->where('a.status', $where['status']);
- })->when(isset($where['type']) && $where['type'] !== '', function ($query) use ($where) {
- $query->where('a.type', $where['type']);
- }) ->when(isset($where['identity']) && $where['identity'] !== '', function ($query) use ($where) {
- $query->where('a.identity', $where['identity']);
- })->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) {
- getModelTime($query, $where['date'], 'a.create_time');
- })->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use ($where) {
- $query->whereLike('a.uid|b.account', "%{$where['keyword']}%");
- });
- }
- }
|