|
|
@@ -44,11 +44,14 @@ class GroupOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
|
|
|
public function queryWhere(){
|
|
|
$where = [];
|
|
|
+ if (!empty($this->params['mobile'])) {
|
|
|
+ $where[] = ['b.mobile', '=', $this->params['mobile']];
|
|
|
+ }
|
|
|
if(!empty($this->params['title'])){
|
|
|
- $where[] = ['b.title', 'like', '%'.$this->params['title'].'%'];
|
|
|
+ $where[] = ['c.title', 'like', '%'.$this->params['title'].'%'];
|
|
|
}
|
|
|
- if (!empty($this->params['mobile'])) {
|
|
|
- $where[] = ['c.mobile', '=', $this->params['mobile']];
|
|
|
+ if(!empty($this->params['area'])){
|
|
|
+ $where[] = ['d.area', 'like', '%'.$this->params['area'].'%'];
|
|
|
}
|
|
|
return $where;
|
|
|
}
|
|
|
@@ -64,15 +67,20 @@ class GroupOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
- $list = GroupOrder::alias('a')->leftJoin('group_activity b', 'b.id = a.group_activity_id')
|
|
|
- ->leftJoin('user c', 'c.id = a.user_id')
|
|
|
+ $list = GroupOrder::alias('a')
|
|
|
+ ->leftJoin('user b', 'b.id = a.user_id')
|
|
|
+ ->leftJoin('group_activity c', 'c.id = a.group_activity_id')
|
|
|
+ ->leftJoin('group_activity_category d', 'd.id = c.group_category_id')
|
|
|
->where($this->searchWhere)
|
|
|
->where($this->queryWhere())
|
|
|
- ->field(['a.*', 'b.title', 'b.image','c.mobile'])
|
|
|
+ ->field(['a.*','b.mobile', 'c.title', 'c.image','d.area'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['a.id' => 'desc'])
|
|
|
->select()
|
|
|
->toArray();
|
|
|
+ foreach($list as &$item) {
|
|
|
+ $item['area'] = explode(",",$item['area']);
|
|
|
+ }
|
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
@@ -86,8 +94,9 @@ class GroupOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
|
public function count(): int
|
|
|
{
|
|
|
return GroupOrder::alias('a')
|
|
|
- ->leftJoin('group_activity b', 'b.id = a.group_activity_id')
|
|
|
- ->leftJoin('user c', 'c.id = a.user_id')
|
|
|
+ ->leftJoin('user b', 'b.id = a.user_id')
|
|
|
+ ->leftJoin('group_activity c', 'c.id = a.group_activity_id')
|
|
|
+ ->leftJoin('group_activity_category d', 'd.id = c.group_category_id')
|
|
|
->where($this->searchWhere)
|
|
|
->where($this->queryWhere())
|
|
|
->count();
|