本文整理汇总了PHP中Network::getTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::getTableName方法的具体用法?PHP Network::getTableName怎么用?PHP Network::getTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::getTableName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFormSetting
public function loadFormSetting(Request $request)
{
$data = $request->all();
$result = array();
$value = $data['value'];
$task_id = isset($data['task_id']) ? $data['task_id'] : 0;
switch ($value) {
case 'ALLOC_CHECK':
case 'ALLOC_RUN':
$network = Network::getTableName();
$allocJob = AllocJob::getTableName();
$tm = [];
$tm = DB::table($network . ' AS a')->join($allocJob . ' AS b', 'a.ID', '=', 'b.NETWORK_ID')->distinct()->get(['a.ID', 'a.NAME']);
$alloc_job = AllocJob::where(['NETWORK_ID' => $tm[0]->ID])->get(['ID', 'NAME']);
$result['network'] = $tm;
$result['allocJob'] = $alloc_job;
break;
case 'VIS_REPORT':
$result = Facility::all(['ID', 'NAME']);
break;
case 'FDC_EU':
$models = ['Facility', 'EnergyUnitGroup', 'CodeReadingFrequency', 'CodeFlowPhase', 'CodeEventType', 'CodeAllocType', 'CodePlanType', 'CodeForecastType'];
foreach ($models as $m) {
$tm = [];
$model = 'App\\Models\\' . $m;
$tm = $model::all(['ID', 'NAME']);
$result[$m] = $tm;
}
break;
case 'FDC_FLOW':
$models = ['Facility', 'CodeReadingFrequency', 'CodeFlowPhase'];
foreach ($models as $m) {
$tm = [];
$model = 'App\\Models\\' . $m;
$tm = $model::all(['ID', 'NAME']);
$result[$m] = $tm;
}
break;
case 'INT_IMPORT_DATA':
$tm = [];
$tm = IntConnection::all(['ID', 'NAME']);
$intTagSet = IntTagSet::where(['CONNECTION_ID' => $tm[0]->ID])->get(['ID', 'NAME']);
$result['IntConnection'] = $tm;
$result['IntTagSet'] = $intTagSet;
break;
default:
$result = [];
}
$task = TmWorkflowTask::where(['ID' => $task_id])->get();
$result['task'] = $task;
$result['value'] = $value;
return response()->json(array('result' => $result));
}
示例2: getLoadSql
public static function getLoadSql()
{
$tableName = Network::getTableName();
return '
SELECT
`' . $tableName . '`.*
FROM
`' . Network::getDbName() . '`.`' . $tableName . '`
';
}