Browse Source

服务商继续使用旧的商户模型

master
lanzu_qsy 5 years ago
parent
commit
71d5427b22
  1. 5
      app/Admin/Metrics/Examples/ServiceCard/TotalStore.php
  2. 2
      app/Models/ImsCjdcStore.php

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

@ -4,6 +4,7 @@
namespace App\Admin\Metrics\Examples\ServiceCard; namespace App\Admin\Metrics\Examples\ServiceCard;
use App\Models\ImsCjdcStore;
use App\Models\LanzuMmInfo; use App\Models\LanzuMmInfo;
use App\Models\LanzuStore; use App\Models\LanzuStore;
use Dcat\Admin\Admin; use Dcat\Admin\Admin;
@ -21,12 +22,12 @@ class TotalStore extends Card
if ($aud->isRole('lanzu_mm')){ if ($aud->isRole('lanzu_mm')){
$mm = LanzuMmInfo::where('admin_user_id',$aud->id)->first(); $mm = LanzuMmInfo::where('admin_user_id',$aud->id)->first();
if ($mm){ if ($mm){
$count = LanzuStore::where('mm_user_id',$mm->user_id)->count();
$count = ImsCjdcStore::where('mm_user_id',$mm->user_id)->count();
} }
}elseif($aud->isRole('lanzu_mp')){ }elseif($aud->isRole('lanzu_mp')){
$count = 0; $count = 0;
}else{ }else{
$count = LanzuStore::count();
$count = ImsCjdcStore::count();
} }
$this->content($count); $this->content($count);
} }

2
app/Models/ImsCjdcStore.php

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

Loading…
Cancel
Save