示例:
---使用舞台------------------------------------------ ------------------------------
$fields = array('user' => ['username','dealername'], 'ordernumber', 'ordernumber_second');
Order::where(function($query) use ($searchquery, $fields) {
foreach ($fields as $relation => $field) {
if (is_array($field)){
$query->whereHas($relation, function ($q) use ($field, $searchquery) {
$q->where(function ($q) use ($field, $searchquery) {
foreach ($field as $relatedField){
$q->orWhere($relatedField, 'like', "%{$searchquery}%");
}
});
});
} else {
$query->orWhere($field, 'like', "%{$searchquery}%");
}
}
})->where('deleted', 0)
- 使用构建作业------------------------------------------ ------------------------------
stage 'myjob'
node('mynode'){
echo "i am in stage"
}