优化税类
This commit is contained in:
parent
0d28e4765e
commit
2503012cd8
|
|
@ -19,10 +19,12 @@ class TaxClassDetail extends JsonResource
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'name' => $this->title,
|
'title' => $this->title,
|
||||||
'description' => sub_string($this->description),
|
'description' => sub_string($this->description),
|
||||||
'created_at' => time_format($this->created_at),
|
'created_at' => time_format($this->created_at),
|
||||||
'updated_at' => time_format($this->updated_at),
|
'updated_at' => time_format($this->updated_at),
|
||||||
|
'tax_rates' => $this->taxRates->toArray(),
|
||||||
|
'tax_rules' => $this->taxRules->toArray(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
namespace Beike\Admin\Repositories;
|
namespace Beike\Admin\Repositories;
|
||||||
|
|
||||||
|
use Beike\Admin\Http\Resources\TaxClassDetail;
|
||||||
use Beike\Models\TaxClass;
|
use Beike\Models\TaxClass;
|
||||||
|
|
||||||
class TaxClassRepo
|
class TaxClassRepo
|
||||||
|
|
@ -19,10 +20,12 @@ class TaxClassRepo
|
||||||
|
|
||||||
public static function getList()
|
public static function getList()
|
||||||
{
|
{
|
||||||
return TaxClass::query()->with([
|
$taxClass = TaxClass::query()->with([
|
||||||
'taxRates.region',
|
'taxRates.region',
|
||||||
'taxRules'
|
'taxRules'
|
||||||
])->get();
|
])->get();
|
||||||
|
|
||||||
|
return TaxClassDetail::collection($taxClass)->jsonSerialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createOrUpdate($data)
|
public static function createOrUpdate($data)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue