mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
changed files according to discussions on Gitlab and tweaked search function
This commit is contained in:
+18
-18
@@ -6,38 +6,38 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Company extends Model
|
||||
{
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
'company_profile',
|
||||
'reg_cert',
|
||||
'company_name',
|
||||
'registration_no',
|
||||
'tax_no',
|
||||
'tel_no',
|
||||
'fax',
|
||||
'address',
|
||||
'city',
|
||||
'postcode',
|
||||
'state',
|
||||
'country',
|
||||
|
||||
'company_profile',
|
||||
'reg_cert',
|
||||
'company_name',
|
||||
'registration_no',
|
||||
'tax_no',
|
||||
'tel_no',
|
||||
'fax',
|
||||
'address',
|
||||
'city',
|
||||
'postcode',
|
||||
'state',
|
||||
'country',
|
||||
'contact_person',
|
||||
'user_id',
|
||||
'user_id',
|
||||
|
||||
];
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
}
|
||||
|
||||
public function deliveryinfo() {
|
||||
public function deliveryInfo() {
|
||||
|
||||
return $this->hasMany('App\Deliveryinfo');
|
||||
|
||||
}
|
||||
|
||||
public function warehouse() {
|
||||
public function warehouses() {
|
||||
|
||||
return $this->hasMany('App\Warehouse');
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Contact extends Model
|
||||
|
||||
}
|
||||
|
||||
public function companies(){
|
||||
public function company(){
|
||||
|
||||
return $this->belongsTo('App\Company');
|
||||
|
||||
|
||||
@@ -22,7 +22,10 @@ class CompanyController extends Controller
|
||||
{
|
||||
foreach ($matchedTerms as $key => $matchedTerm)
|
||||
{
|
||||
if($matchedTerm->id != Auth::user()->company()->first()->id)
|
||||
{
|
||||
array_push($output, ['recipient_id'=> $matchedTerm->id, 'company_name' => $matchedTerm->company_name, 'tel_no' => $matchedTerm->tel_no, 'contact_person'=>$matchedTerm->contact_person ]);
|
||||
}
|
||||
}
|
||||
|
||||
return response($output);
|
||||
|
||||
Reference in New Issue
Block a user