|
@@ -91,10 +91,9 @@ class NameRuleController extends Controller
|
|
public function enabled()
|
|
public function enabled()
|
|
{
|
|
{
|
|
$namingRules = NamingRule::where('status', 1)->where(function ($query) {
|
|
$namingRules = NamingRule::where('status', 1)->where(function ($query) {
|
|
- return $query->where("company_id", Auth::user()->company_id)->orWhere([
|
|
|
|
- 'company_id' => 0,
|
|
|
|
- 'global' => 1
|
|
|
|
- ]);
|
|
|
|
|
|
+ return $query->where("company_id", Auth::user()->company_id)->orWhere(function ($query){
|
|
|
|
+ $query->where('company_id',0)->where( 'global',1);
|
|
|
|
+ });
|
|
})->select(['id', 'name'])->get();
|
|
})->select(['id', 'name'])->get();
|
|
|
|
|
|
return $this->success([
|
|
return $this->success([
|