<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use App\Traits\ModelLogChanging;

class OracleDOCWaveDetails extends Model
{
    use ModelLogChanging;

    protected $connection='oracle';
    protected $table='DOC_WAVE_DETAILS';
    public $timestamps=false;
    protected $primaryKey = 'OrderNo';
    function getIncrementing()
    {
        return false;
    }

    static public function unpackedOrders($batchNumber){
        return OracleDOCWaveDetails::query()->where('doc_wave_details.waveno', $batchNumber)->leftJoin('doc_order_header','doc_order_header.orderno','doc_wave_details.orderno')->where(function ($query){
            $query->where('doc_order_header.SOSTATUS','<>','99')->where('doc_order_header.SOSTATUS','<>','63');
        })->get();
    }
}
