CompanyModel.php 553 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class CompanyModel extends Model
  5. {
  6. protected $table = "company_info";
  7. public $timestamps = false;
  8. public function contact_persons()
  9. {
  10. return $this->hasMany('App\Models\AddressBookModel','company_id','id');
  11. }
  12. public function mtask()
  13. {
  14. return $this->belongsTo('App\Models\Task','id','client_id')->orderBy('id','DESC');
  15. }
  16. public function invoice()
  17. {
  18. return $this->hasMany('App\Models\Invoice','client_id','id');
  19. }
  20. }