13 changed files with 172 additions and 25 deletions
-
21app/Admin/Controllers/HomeController.php
-
7app/Admin/Controllers/ImsCjdcStoreController.php
-
15app/Admin/Controllers/LanzuFinancialRecord.php
-
2app/Admin/Controllers/LanzuMmInfoController.php
-
2app/Admin/Controllers/LanzuMmWithdrawController.php
-
15app/Admin/Metrics/Examples/Community/TotalAmount.php
-
33app/Admin/Metrics/Examples/ServiceCard/TotalMm.php
-
32app/Admin/Metrics/Examples/ServiceCard/TotalMp.php
-
43app/Admin/Metrics/Examples/ServiceCard/TotalStore.php
-
1app/Admin/routes.php
-
2app/Models/ImsCjdcStore.php
-
18app/Models/LanzuMmInfo.php
-
2app/Models/LanzuStore.php
@ -0,0 +1,33 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\Admin\Metrics\Examples\ServiceCard; |
||||
|
|
||||
|
|
||||
|
use App\Models\LanzuMmInfo; |
||||
|
use App\Models\LanzuMpInfo; |
||||
|
use Dcat\Admin\Widgets\Metrics\Card; |
||||
|
|
||||
|
class TotalMm extends Card |
||||
|
{ |
||||
|
protected function init() |
||||
|
{ |
||||
|
parent::init(); |
||||
|
$this->title = '市场经理数'; |
||||
|
|
||||
|
$this->content(LanzuMmInfo::getMmInfoCount()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 渲染卡片内容 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function renderContent() |
||||
|
{ |
||||
|
$content = parent::renderContent(); |
||||
|
return <<<HTML |
||||
|
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px"> |
||||
|
<h2 class="ml-1 font-large-1">{$content}</h2> |
||||
|
</div> |
||||
|
HTML; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Admin\Metrics\Examples\ServiceCard; |
||||
|
|
||||
|
|
||||
|
use App\Models\LanzuMpInfo; |
||||
|
use Dcat\Admin\Widgets\Metrics\Card; |
||||
|
|
||||
|
class TotalMp extends Card |
||||
|
{ |
||||
|
protected function init() |
||||
|
{ |
||||
|
parent::init(); |
||||
|
$this->title = '服务商量数'; |
||||
|
$this->content(LanzuMpInfo::count()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 渲染卡片内容 |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function renderContent() |
||||
|
{ |
||||
|
$content = parent::renderContent(); |
||||
|
return <<<HTML |
||||
|
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px"> |
||||
|
<h2 class="ml-1 font-large-1">{$content}</h2> |
||||
|
</div> |
||||
|
HTML; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Admin\Metrics\Examples\ServiceCard; |
||||
|
|
||||
|
|
||||
|
use App\Models\LanzuMmInfo; |
||||
|
use App\Models\LanzuStore; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Widgets\Metrics\Card; |
||||
|
|
||||
|
class TotalStore extends Card |
||||
|
{ |
||||
|
|
||||
|
protected function init() |
||||
|
{ |
||||
|
parent::init(); |
||||
|
$this->title = '商户数'; |
||||
|
$aud = Admin::user(); |
||||
|
$count = 0; |
||||
|
if ($aud->isRole('lanzu_mm')){ |
||||
|
$mm = LanzuMmInfo::where('admin_user_id',$aud->id)->first(); |
||||
|
if ($mm){ |
||||
|
$count = LanzuStore::where('mm_user_id',$mm->user_id)->count(); |
||||
|
} |
||||
|
}elseif($aud->isRole('lanzu_mp')){ |
||||
|
$count = 0; |
||||
|
}else{ |
||||
|
$count = LanzuStore::count(); |
||||
|
} |
||||
|
$this->content($count); |
||||
|
} |
||||
|
|
||||
|
public function renderContent() |
||||
|
{ |
||||
|
$content = parent::renderContent(); |
||||
|
return <<<HTML |
||||
|
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px"> |
||||
|
<h2 class="ml-1 font-large-1">{$content}</h2> |
||||
|
</div> |
||||
|
HTML; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue