master
cody 6 months ago
parent 261505f623
commit 66ebf3f1af

@ -46,7 +46,11 @@ class SupplyDemandController extends CommonController
public function index() public function index()
{ {
$all = request()->all(); $all = request()->all();
$supplyDemands = SupplyDemand::where(function ($query) use ($all) { $supplyDemands = SupplyDemand::with([
'user' => function ($query) {
$query->select('id', 'nickname', 'name', 'headimgurl');
}
])->where(function ($query) use ($all) {
if (isset($all['type'])) { if (isset($all['type'])) {
$query->where('type', $all['type']); $query->where('type', $all['type']);
} }

Loading…
Cancel
Save