<?php

namespace App\Models\Summary;

use Illuminate\Database\Eloquent\Model;
use DB;
class XeroFeesSummary extends Model
{
    protected $connection = 'shopify';
    protected $dates = [''];
    protected $table = 'xero_summary_fees';
    protected $connection = 'mysqlXeroMasterCred';
    protected $rules = array(
        
    );
    protected $fillable =['seller_id','module','marketplace_primary_id','marketplace_record_type','document_number','invoice_date','json_amount','tax_type','total_amount','gateway','currency','data'
    ,'reference'];
    protected $injectUniqueIdentifier = true;
    public function scopeTextsearch($query, $search, $type)
    {
      return $query->where(function ($query) use ($search) 
      {
        $query
          ->where('document_number', 'LIKE', "%$search%")
          ->orWhere('invoice_date', 'LIKE', "%$search%")
          ->orWhere('sync_status', 'LIKE', "%$search%")
          ->orWhere('total_amount', 'LIKE', "%$search%")
          ->orWhere('gateway', 'LIKE', "%$search%")
          ->orWhere('currency', 'LIKE', "%$search%");
      });
    }
}
