Files
admin-php-module/models/ExchangeItems.php
miroman-afk c4dc6e02a0 v.2.30
Добавлен расширенный отчет по реализации
Добавлен монитор активности
2023-08-03 11:05:15 +03:00

36 lines
965 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Component\Models;
use Illuminate\Database\Eloquent\Model;
class ExchangeItems extends Model
{
protected $table = 'exchange_items';
/**
* Получить информацию о действиях добавления позиции.
*/
public function create_info()
{
return $this->hasMany(ExchangeActions::class, 'order_position', 'code')
->where('exchange_actions.action_type', '=', 2);
}
/**
* Получить информацию о действиях удаления позиции.
*/
public function delete_info()
{
return $this->hasMany(ExchangeActions::class, 'order_position', 'code')
->where('exchange_actions.action_type', '=', 5);
}
/**
* Получить информацию о заказе.
*/
public function order()
{
return $this->hasOne(ExchangeOrders::class, 'code', 'order_code');
}
}