限制小程序查询数据

This commit is contained in:
liu 2024-06-26 18:32:27 +08:00
parent eb0aa5b6fc
commit c5a21a867b

View File

@ -46,7 +46,8 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
{
$userId = $this->request->userId;
if (!$userId) return [];
$data = StoreOrder::with(['store'])->where($this->searchWhere)->where('uid', $userId)
$data = StoreOrder::with(['store'])->where($this->searchWhere)->where(['uid'=>$userId])
->whereIn('shipping_type',[1,2])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
@ -86,6 +87,6 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
public function count(): int
{
$userId = $this->request->userId;
return StoreOrder::where($this->searchWhere)->where('uid', $userId)->count();
return StoreOrder::where($this->searchWhere)->whereIn('shipping_type',[1,2])->where('uid', $userId)->count();
}
}