Browse Source

增加服务商卡片数据

master
lanzu_qsy 5 years ago
parent
commit
fed490fa4c
  1. 2
      app/Admin/Controllers/ImsCjdcStoreController.php
  2. 2
      app/Admin/Controllers/LanzuMmInfoController.php
  3. 2
      app/Admin/Controllers/LanzuMmWithdrawController.php
  4. 18
      app/Admin/Metrics/Examples/ServiceCard/TotalStore.php
  5. 2
      app/Models/ImsCjdcStore.php
  6. 2
      app/Models/LanzuStore.php

2
app/Admin/Controllers/ImsCjdcStoreController.php

@ -27,7 +27,7 @@ class ImsCjdcStoreController extends AdminController
if ($user->isRole('lanzu_mm')) {
//如果登陆角色为市场经理,获取市场经理id
$mm = LanzuMmInfo::where(['admin_user_id' => $user->id])->first();
$builder = modelStore::where(['mm_user_id' => $mm->id]);
$builder = modelStore::with('market')->where(['mm_user_id' => $mm->id]);
}
return Grid::make($builder, function (Grid $grid) {
$grid->id->sortable();

2
app/Admin/Controllers/LanzuMmInfoController.php

@ -50,7 +50,7 @@ class LanzuMmInfoController extends AdminController
return $market->name;
});
$grid->column('可提现金额')->display(function () {
return MpBalance::getBalance($this->user_id, 0);
return MpBalance::getBalance($this->admin_user_id, 2);
});
$grid->id_frond->image('', 50, 50);
$grid->id_back->image('', 50, 50);

2
app/Admin/Controllers/LanzuMmWithdrawController.php

@ -68,7 +68,7 @@ class LanzuMmWithdrawController extends AdminController
$grid->money;
$grid->status('提现状态')->using([-1 => '拒绝', 0 => '审核中', 1 => '通过'])
->label([-1 => 'danger', 0 => 'default', 1 => 'success']);
$grid->is_pay('是否到账')->using([0 => '否', 1 => '是']);
$grid->is_pay('是否到账')->using([0 => '否', 1 => '是'])->label([0 => 'danger', 1 => 'success']);
$grid->created_at('提现时间')->display(function ($time) {
return date('Y-m-d H:i', $time);
});

18
app/Admin/Metrics/Examples/ServiceCard/TotalStore.php

@ -4,15 +4,31 @@
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 = '商户数';
$this->content(222);
$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->id)->count();
}
}elseif($aud->isRole('lanzu_mp')){
$count = 0;
}else{
$count = LanzuStore::count();
}
$this->content($count);
}
public function renderContent()

2
app/Models/ImsCjdcStore.php

@ -10,7 +10,7 @@ use App\Models\StoreAccount;
class ImsCjdcStore extends Model
{
use HasDateTimeFormatter;
protected $table = 'ims_cjdc_store';
protected $table = 'lanzu_store';
public $timestamps = false;
public function market(){
return $this->hasOne('\App\Models\ImsCjdcMarket','id','market_id');

2
app/Models/LanzuStore.php

@ -9,6 +9,6 @@ use Illuminate\Database\Eloquent\Model;
class LanzuStore extends Model
{
use HasDateTimeFormatter;
protected $table = 'ims_cjdc_store';
protected $table = 'lanzu_store';
protected $dateFormat = 'U';
}
Loading…
Cancel
Save