!119 add ms hook

* wip
* 优化
* wip
* 文件管理器
* add ms hook
This commit is contained in:
pushuo 2023-06-07 02:57:07 +00:00 committed by Edward Yang
parent fb1c2e4c1c
commit 2b7b0a9011
5 changed files with 17 additions and 12 deletions

View File

@ -87,7 +87,7 @@ class FileManagerService
if ($baseName == 'index.html') {
continue;
}
$fileName = str_replace($this->fileBasePath, '', $file);
$fileName = str_replace(public_path('catalog'), '', $file);
if (is_file($file)) {
$images[] = $this->handleImage($fileName, $baseName);
}

View File

@ -73,10 +73,8 @@ class Order extends Base
public function getStatusFormatAttribute()
{
$status_format = trans('order.' . $this->status);
$status_format = hook_filter('order.status_format', $status_format);
return $status_format;
$statusMap = array_column(StateMachineService::getAllStatuses(), 'name', 'status');
return $statusMap[$this->status];
}
public function getTotalFormatAttribute()

View File

@ -11,6 +11,8 @@
namespace Beike\Models;
use Beike\Services\StateMachineService;
class OrderHistory extends Base
{
protected $fillable = [
@ -21,6 +23,7 @@ class OrderHistory extends Base
public function getStatusFormatAttribute()
{
return trans("order.{$this->status}");
$statusMap = array_column(StateMachineService::getAllStatuses(), 'name', 'status');
return $statusMap[$this->status];
}
}

View File

@ -79,7 +79,7 @@ class OrderRepo
*/
public static function getListBuilder(array $filters = []): Builder
{
$builder = Order::query()->with(['orderProducts']);
$builder = Order::query()->with(['orderProducts'])->where('status', '<>', StateMachineService::CREATED);
$number = $filters['number'] ?? 0;
if ($number) {

View File

@ -56,17 +56,21 @@
</div>
@endif
@endhookwrapper
@hook('header.top.left')
</div>
@hook('header.top.language.after')
@if (system_setting('base.telephone', ''))
<div class="right nav">
@hookwrapper('header.top.telephone')
<span class="px-2"><i class="bi bi-telephone-forward me-2"></i> {{ system_setting('base.telephone') }}</span>
@endhookwrapper
@if (system_setting('base.telephone', ''))
@hookwrapper('header.top.telephone')
<div class="px-2 my-auto"><i class="bi bi-telephone-forward me-2"></i> {{ system_setting('base.telephone') }}</div>
@endhookwrapper
@endif
@hook('header.top.right')
</div>
@endif
</div>
</div>