mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
commit
4acd1bf644
@ -11,12 +11,13 @@ class AdvsImport implements ToModel, WithHeadingRow
|
|||||||
{
|
{
|
||||||
public function model(array $row)
|
public function model(array $row)
|
||||||
{
|
{
|
||||||
|
$row['name'] = $row['name'] ?? $row['title'];
|
||||||
if ($row['name'] !== null && $row['price'] !== null && $row['currency'] !== null) {
|
if ($row['name'] !== null && $row['price'] !== null && $row['currency'] !== null) {
|
||||||
return new AdvModel([
|
return new AdvModel([
|
||||||
'name' => $row['name'],
|
'name' => $row['name'],
|
||||||
'slug' => Str::slug($row['name']),
|
'slug' => Str::slug($row['name']),
|
||||||
'advs_desc' => $row['description'] ?? null,
|
'advs_desc' => $row['description'] ?? null,
|
||||||
'standard_price' => $row['standard_price'] ?? null,
|
'standard_price' => $row['standard_price'] ?? 0,
|
||||||
'price' => $row['price'],
|
'price' => $row['price'],
|
||||||
'currency' => $row['currency'],
|
'currency' => $row['currency'],
|
||||||
'country' => $row['country'] ?? null,
|
'country' => $row['country'] ?? null,
|
||||||
|
|||||||
@ -16,9 +16,11 @@ class AddTotalSales
|
|||||||
public function handle(CreatedOrderDetail $event)
|
public function handle(CreatedOrderDetail $event)
|
||||||
{
|
{
|
||||||
$item = $event->getOrderItem();
|
$item = $event->getOrderItem();
|
||||||
$adv = $this->advModel->find($event->getOrderItem()->item_id);
|
if ($item->item_type === 'adv') {
|
||||||
$total = $adv->total_sales + $item->piece;
|
$adv = $this->advModel->find($event->getOrderItem()->item_id);
|
||||||
$adv->total_sales = $total;
|
$total = $adv->total_sales + $item->piece;
|
||||||
$adv->save();
|
$adv->total_sales = $total;
|
||||||
|
$adv->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
{% extends "theme::layouts/default" %}
|
{% extends "theme::layouts/default" %}
|
||||||
|
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
|
<link rel="canonical" href="{{ url() }}"/>
|
||||||
|
|
||||||
{{ asset_style('visiosoft.theme.base::css/login.css') }}
|
{{ asset_style('visiosoft.theme.base::css/login.css') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -103,4 +105,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ asset_add('scripts.js','visiosoft.theme.base::js/login.js') }}
|
{{ asset_add('scripts.js','visiosoft.theme.base::js/login.js') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user