large commit

This commit is contained in:
Omair Saleh
2019-10-07 12:41:37 +08:00
parent 14e14d9c38
commit ec06ee88d2
3 changed files with 13 additions and 9 deletions
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Orders;
use App\Classes\Modules\Orders\DataTransferObjects\PackingListObject;
use App\Models\AddressBook;
use App\Models\Company;
use App\Models\Contact;
use App\Models\CustomIssues;
use App\Models\Order;
use App\Models\OrderWarehouse;
@@ -75,11 +76,13 @@ class OrderController extends Controller
$order = order::findOrFail($orderId);
$warehouse = OrderWarehouse::where('order_id', $orderId)->firstOrFail();
$warehouseAddress = AddressBook::where('type', 2)->where('reference_id', $warehouse->id)->firstOrFail();
$warehouseContact = Contact::where('type', 2)->where('reference_id', $warehouse->id)->get();
$data = [
'order' => $order,
'company' => Company::findOrFail($order->company_id),
'delivery_address' => AddressBook::where('id', $order->address_id)->first(),
'warehouse_address' => $warehouseAddress
'warehouse_address' => $warehouseAddress,
'warehouse_contact' => $warehouseContact
];
return view('pages.pdf.qr', $data);
+7 -6
View File
@@ -14,16 +14,17 @@ class Warehouse extends JsonResource
*/
public function toArray($request)
{
$billing = $this->addressBook()->where('reference_id', $this->id)->where('type', 2)->where('billing', true)->first();
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'street_one' => $this->street_one,
'street_two' => $this->street_two,
'city' => $this->city,
'state' => $this->state,
'post_code' => $this->post_code,
'country' => $this->country
'street_one' => $billing ? $billing->street_one : null,
'street_two' => $billing ? $billing->street_two : null,
'city' => $billing ? $billing->city : null,
'state' => $billing ? $billing->state : null,
'post_code' => $billing ? $billing->post_code : null,
'country' => $billing ? $billing->country : null
];
}
}
+2 -2
View File
@@ -57,8 +57,8 @@
<tr>
<td>
<p style="font-size: 12px; margin-bottom: 0 !important; margin-top: 10px !important;">仓库地址:</p>
<p style="margin-top: 5px !important; margin-bottom: 5px !important; word-wrap: break-word; font-size: 16px;">{{$warehouse_address->street_one.' '.$warehouse_address->street_two.' '.$warehouse_address->city.' '.$warehouse_address->post_code.' '.$warehouse_address->state}}</p>
{{--<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 12px;">联系电话:杨先生 13900055019 / 梁先生 18529309778</p>--}}
<p style="margin-top: 5px !important; margin-bottom: 5px !important; word-wrap: break-word; font-size: 16px;">{{$warehouse_address->street_one.' '.$warehouse_address->street_two.' '.$warehouse_address->city.' '.$warehouse_address->state.' 邮编:'.$warehouse_address->post_code}}</p>
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 12px;">联系{{$warehouse_contacts[0]->contact.' '.$warehouse_contacts[0]->name}} / {{$warehouse_contacts[1]->contact.' '.$warehouse_contacts[1]->name}}</p>
</td>
</tr>
</tbody>