Skip to content

Commit

Permalink
Fix mismatch of suppliers and clients in dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoguang Sun <sunxiaoguang@gmail.com>
  • Loading branch information
sunxiaoguang committed Apr 29, 2024
1 parent 5a8c740 commit 7e6951a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
23 changes: 10 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM php:8.2-fpm

WORKDIR /app
COPY . .

# Install system dependencies
RUN apt-get update && apt-get install -y \
RUN --mount=type=secret,id=env,target=/app/.env \
sed -i 's/deb.debian.org/mirrors.volces.com/g' /etc/apt/sources.list.d/debian.sources && apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
Expand All @@ -18,16 +22,9 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install gd \
&& docker-php-ext-install zip \
&& docker-php-source delete

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer

WORKDIR /app
COPY . .
&& docker-php-source delete \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& npm config set registry http://registry.npmmirror.com && npm ci && composer install --optimize-autoloader --no-dev && php artisan view:cache && npm run production && php artisan storage:link

RUN npm ci
RUN composer install
ENTRYPOINT php artisan serve --host=0.0.0.0 --port 8000
5 changes: 5 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Support\Facades\Auth;
use App\Models\Admin\EstimatedBudgets;
use App\Models\Methods\MethodsServices;
use Illuminate\Support\Facades\Log;

class HomeController extends Controller
{
Expand Down Expand Up @@ -42,6 +43,10 @@ public function index()
return $data;
}, []);

$data_str = var_export($data, true);

Log::info("data = {$data_str}");

$Announcement = Announcements::latest()->first();

//Estimated Budgets data for chart
Expand Down
4 changes: 2 additions & 2 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<div class="row">
<div class="col-lg-2 col-6">
<x-adminlte-small-box title="{{$data['suppliers_count']}}"
<x-adminlte-small-box title="{{$data['customers_count']}}"
text="{{ __('general_content.client_trans_key') }}"
icon="far fa-building"
theme="info"
Expand All @@ -31,7 +31,7 @@
</div>
<!-- ./col -->
<div class="col-lg-2 col-6">
<x-adminlte-small-box title="{{ $data['customers_count'] }}"
<x-adminlte-small-box title="{{ $data['suppliers_count'] }}"
text="{{ __('general_content.suppliers_trans_key') }}"
icon="far fa-building"
theme="success"
Expand Down

0 comments on commit 7e6951a

Please sign in to comment.