瀏覽代碼

get-database

allo_data_retrieve^2
Siti Hajar Ibrahim 5 年之前
父節點
當前提交
fa8823bfb4
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      app/Http/Controllers/Controller.php

+ 5
- 4
app/Http/Controllers/Controller.php 查看文件

$staff = Staff::with('staffdetail')->where('email', 'dealer@test.my')->first(); $staff = Staff::with('staffdetail')->where('email', 'dealer@test.my')->first();
$company = Company::where('name', 'TNBX Sdn Bhd')->first(); $company = Company::where('name', 'TNBX Sdn Bhd')->first();
$staff->company_id = $company->_id; $staff->company_id = $company->_id;
$staff->staffdetail->company_id = $company->_id;
$staff->staffdetail()->save();
$staff->save(); $staff->save();

return $company . $staff;
$staffD = StaffDetail::where('_id',$staff->_id)->first();
$staffD->company_id = $company->_id;
$staffD->save();
return $company . $staff . $staffD;
} }


public function adjustInstaller(Request $request){ public function adjustInstaller(Request $request){

Loading…
取消
儲存