2023-04-03 20:25:57 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Filters;
|
|
|
|
|
|
|
|
|
|
use App\Models\Goods;
|
|
|
|
|
use App\Models\GoodsSku;
|
|
|
|
|
|
|
|
|
|
class GoodsSkuLocationFilter extends Filters
|
|
|
|
|
{
|
|
|
|
|
public function date($value)
|
|
|
|
|
{
|
2023-04-17 18:56:59 +08:00
|
|
|
return $this->builder->where('date', $value);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function goodsTitle($value)
|
|
|
|
|
{
|
|
|
|
|
$goodsId = Goods::query()->where('title', $value)->value('id');
|
|
|
|
|
|
2023-04-17 18:56:59 +08:00
|
|
|
return $this->builder->where('goods_id', $goodsId);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function goodsCode($value)
|
|
|
|
|
{
|
|
|
|
|
$goodsId = Goods::query()->where('goods_code', $value)->value('id');
|
|
|
|
|
|
2023-04-17 18:56:59 +08:00
|
|
|
return $this->builder->where('goods_id', $goodsId);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function externalSkuId($value)
|
|
|
|
|
{
|
2023-04-18 11:22:16 +08:00
|
|
|
return $this->builder->where('external_sku_id', $value);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function location($value)
|
|
|
|
|
{
|
2023-04-17 18:56:59 +08:00
|
|
|
return $this->builder->where('location', $value);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function status($value)
|
|
|
|
|
{
|
2023-04-17 18:56:59 +08:00
|
|
|
return $this->builder->where('status', $value);
|
2023-04-03 20:25:57 +08:00
|
|
|
}
|
|
|
|
|
}
|