from server
This commit is contained in:
parent
0e8c9277ef
commit
c00fa69a05
|
|
@ -57,9 +57,9 @@ return [
|
||||||
'engine' => 'InnoDB',
|
'engine' => 'InnoDB',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'port' => 3306,
|
'port' => 3306,
|
||||||
'database' => 'gok_bakja_from_server2',
|
'database' => 'gok_bakja_12',
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
'password' => 'bt110226',
|
'password' => '',
|
||||||
'charset' => 'utf8mb4',
|
'charset' => 'utf8mb4',
|
||||||
'collation' => 'utf8mb4_unicode_ci',
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ class Order extends ComponentBase
|
||||||
|
|
||||||
$html_data = '';
|
$html_data = '';
|
||||||
|
|
||||||
$orderDatas = OrderModel::with(["client", "shipping"])
|
$orderDatas = OrderModel::with(["client", "shipping", "shippingTransport"])
|
||||||
->withCount(['order_items as qty'])
|
->withCount(['order_items as qty'])
|
||||||
->withCount(['order_items as order_all_price' => function ($query) {
|
->withCount(['order_items as order_all_price' => function ($query) {
|
||||||
$query->select(DB::raw('sum(price) * sum(amount) / qty'));
|
$query->select(DB::raw('sum(price) * sum(amount) / qty'));
|
||||||
|
|
@ -298,7 +298,39 @@ class Order extends ComponentBase
|
||||||
} else{
|
} else{
|
||||||
$mustPay = $mustPayCalc.' $';
|
$mustPay = $mustPayCalc.' $';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($orderDatas[$x]->shippingTransport == null){
|
||||||
|
|
||||||
|
$shippingDate = '';
|
||||||
|
$status = '';
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$shippingDate = Carbon::parse($orderDatas[$x]->shippingTransport->date)->format('d.m.Y') ?? '';
|
||||||
|
|
||||||
|
if ($orderDatas[$x]->shippingTransport->status == "loaded") {
|
||||||
|
$status = '<span class="badge badge-soft-info"
|
||||||
|
style="font-size: 14px;">ÝÜKLENDI</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($orderDatas[$x]->shippingTransport->status == "loading") {
|
||||||
|
$status = '<span class="badge badge-soft-primary"
|
||||||
|
style="font-size: 14px;">ÝÜKLENÝÄR</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($orderDatas[$x]->shippingTransport->status == "proccess") {
|
||||||
|
$status = '<span class="badge badge-soft-warning"
|
||||||
|
style="font-size: 14px;">ÝOLDA</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($orderDatas[$x]->shippingTransport->status == "complated") {
|
||||||
|
$status = '<span class="badge badge-soft-success"
|
||||||
|
style="font-size: 14px;">TAMAMLANDY</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$html_data .= '<tr>
|
$html_data .= '<tr>
|
||||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||||
<td><a href="/order-detail/' . $orderDatas[$x]->id . '" style="font-weight: bold;">Sargyt #' . $orderDatas[$x]->id . '</a></td>
|
<td><a href="/order-detail/' . $orderDatas[$x]->id . '" style="font-weight: bold;">Sargyt #' . $orderDatas[$x]->id . '</a></td>
|
||||||
|
|
@ -313,7 +345,8 @@ class Order extends ComponentBase
|
||||||
</td>
|
</td>
|
||||||
<td><a href="#" class="badge badge-soft-danger" style="font-size: 14px;">' . $mustPay . '</a>
|
<td><a href="#" class="badge badge-soft-danger" style="font-size: 14px;">' . $mustPay . '</a>
|
||||||
</td>
|
</td>
|
||||||
<td>' . $orderDatas[$x]->created_at->format('d.m.Y') . '</td>
|
<td>' .$shippingDate . '</td>
|
||||||
|
<td>' .$status . '</td>
|
||||||
<td>' . $orderDatas[$x]->note . '</td>
|
<td>' . $orderDatas[$x]->note . '</td>
|
||||||
<td>'.$editBtn.'</td>
|
<td>'.$editBtn.'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
|
||||||
|
|
@ -244,8 +244,8 @@ class OrderItem extends ComponentBase
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form data-request="onUpdateOrderItemPrice" method="POST" data-request-flash>
|
<form data-request="onUpdateOrderItemPrice" method="POST" data-request-flash>
|
||||||
<input type="number" step="0.01" pattern="/^-?\d+\.?\d*$/"
|
<input type="number" step="0.0001" pattern="/^-?\d+\.?\d*$/"
|
||||||
onKeyPress="if(this.value.length==4) return false;"
|
onKeyPress="if(this.value.length==7) return false;"
|
||||||
name="price" class="form-control"
|
name="price" class="form-control"
|
||||||
placeholder="%"
|
placeholder="%"
|
||||||
value="' . $orderItem->price . '">
|
value="' . $orderItem->price . '">
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,13 @@ class Order extends Model
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public $hasOne = [
|
||||||
|
'shippingTransport' => [
|
||||||
|
'Romanah\Gokbakja\Models\ShippingTransport',
|
||||||
|
'key' => 'order_id'
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The database table used by the model.
|
* @var string The database table used by the model.
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,8 @@ function onStart(){
|
||||||
<th>Bahasy</th>
|
<th>Bahasy</th>
|
||||||
<th>Tölenen</th>
|
<th>Tölenen</th>
|
||||||
<th>Bergisi</th>
|
<th>Bergisi</th>
|
||||||
<th>Senesi</th>
|
<th>Ugramaly Senesi</th>
|
||||||
|
<th>Status</th>
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
<th>Sazlamalar</th>
|
<th>Sazlamalar</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -128,7 +129,8 @@ function onStart(){
|
||||||
<th>Bahasy</th>
|
<th>Bahasy</th>
|
||||||
<th>Tölenen</th>
|
<th>Tölenen</th>
|
||||||
<th>Bergisi</th>
|
<th>Bergisi</th>
|
||||||
<th>Senesi</th>
|
<th>Ugramaly Senesi</th>
|
||||||
|
<th>Status</th>
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
<th>Sazlamalar</th>
|
<th>Sazlamalar</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -159,4 +161,4 @@ function onStart(){
|
||||||
|
|
||||||
{% endput %}
|
{% endput %}
|
||||||
|
|
||||||
{% partial 'dataTableJs' %}
|
{% partial 'dataTableJs' %}
|
||||||
Loading…
Reference in New Issue