本文整理汇总了PHP中app\models\File::join方法的典型用法代码示例。如果您正苦于以下问题:PHP File::join方法的具体用法?PHP File::join怎么用?PHP File::join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\File
的用法示例。
在下文中一共展示了File::join方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index($date, $file)
{
/*$fields = Field::select('fields.value', 'field_taxonomy_table.title')
->join('field_taxonomy_table', 'fields.field_taxonomy_id', '=', 'field_taxonomy_table.id')
->join('files', 'field_taxonomy_table.file_id', '=', 'files.id')
->where('files.parsed_title', '=', $file)
->get();
dd($fields);*/
$fields = File::join('file_field_taxonomy_table as fftt', 'fftt.file_id', '=', 'files.id')->join('field_taxonomy_table as ftt', 'fftt.field_taxonomy_id', '=', 'ftt.id')->where('files.parsed_title', '=', $file)->select('ftt.title', 'ftt.id')->groupBy('ftt.title');
if ($file === "claimsbybatch") {
$fields = $fields->where('title', '=', 'claim_status_ud')->orWhere('title', '=', 'claim_procedure_status_ud')->orWhere('title', '=', 'from_service_date')->orWhere('title', '=', 'clean_claim_date')->orWhere('title', '=', 'received_date')->orWhere('title', '=', 'benefitplan_ud');
}
$titleArr = [];
//loop through all of the results
foreach ($fields->get() as $field) {
//split the title at the underscore
$title = explode('_', $field->title);
$count = 0;
$isDate = false;
$type = "string";
$arrValues = [];
//loop through the title arr
foreach ($title as $word) {
if ($word === "date") {
$isDate = true;
}
//remove the "ud" from the title arr
if ($word === "ud") {
unset($title[$count]);
} else {
//if it's benefit plan, then split it up
if ($title[$count] === "benefitplan") {
$title[$count] = "benefit plan";
}
//make each word proper case
$title[$count] = ucfirst($title[$count]);
}
$count++;
}
if ($isDate) {
$titleArr['date'][] = ['title' => implode(' ', $title), 'db_title' => $field->title, 'value' => $arrValues];
} else {
$arrValues = Field_Taxonomy::select('value')->distinct()->join('fields', 'fields.field_taxonomy_id', '=', 'field_taxonomy_table.id')->where('title', '=', $field->title)->get();
$titleArr['other'][] = ['title' => implode(' ', $title), 'db_title' => $field->title, 'value' => $arrValues];
}
}
return view("reports.main")->with('data', $titleArr);
}