| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | <?phpnamespace App\Service;use App\Jobs\ProcessDataJob;use App\Model\Depart;use App\Model\Employee;use App\Model\EmployeeDepartPermission;use App\Model\EmployeeIndex;use App\Model\Product;use App\Model\RevenueCost;use App\Model\RevenueCostTotal;use App\Model\SalaryEmployee;use Illuminate\Database\Schema\Blueprint;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Schema;class U8ServerService extends Service{    protected $databaseService;    /**     * @var string|null     */    protected $error;    /**     * U8ServerService constructor.     */    public function __construct($loginUser = [])    {        $service = new U8DatabaseServerService($loginUser);        $this->databaseService = $service->db;        $this->error = $service->error;    }    /**     * 获取错误信息     *     * @return string|null     */    public function getError()    {        return $this->error;    }    public function purchaseRequisition($data, $user){        $model = $this->databaseService->table('DispatchList as a')            ->leftJoin('DispatchLists as b', 'b.DLID', 'a.DLID')            ->leftJoin('Inventory as c', 'c.cInvCode', 'b.cInvCode')            ->select('a.cDLCode as cdlcode', 'a.DLID as id', 'a.cCusName as customer_name', 'b.cSOCode as csocode', 'a.cDepCode as cdepcode', 'a.cCusCode as cuscode', 'a.dDate as date','b.irowno', 'b.iDLsID as idlsid', 'b.cWhCode as cwhcode', 'b.cInvCode as cinvcode', 'b.cInvName as product_title', 'b.cFree1 as cfree1', 'b.cFree2 as cfree2', 'b.cPosition as cposition', 'b.cBatch as cbatch', 'b.iQuantity as iquantity', 'b.iNum as inum', 'b.iInvExchRate as iinvexchrate', 'b.fOutQuantity as out_quantity', 'b.iUnitPrice as iunitcost', 'b.iMoney as imoney', 'b.cDefine28 as technology_material', 'b.cDefine30 as process_mark', 'c.cInvStd as product_size', DB::raw('(b.iQuantity - b.fOutQuantity) as quantity'), 'a.cMemo as table_header_mark', 'b.cMemo as table_body_mark');       $list = $this->limit($model,'',$data);       return [true , $list];    }}
 |