This commit is contained in:
2025-03-22 12:13:30 +08:00
parent 294f083ae9
commit 6711702837
14 changed files with 41 additions and 2 deletions

View File

@@ -195,3 +195,20 @@ if (!function_exists('build_heading')) {
return $result;
}
}
function session_admin($key=''){
$admin = session('admin');
if($key){
return $admin[$key];
}
return $admin;
}
function session_admin_firm_id(){
$admin = session('admin.firm_id');
return $admin;
}
function session_admin_firmstore_id(){
$admin = session('admin.firmstore_id');
return $admin;
}

View File

@@ -23,6 +23,7 @@ class Dashboard extends Backend
*/
public function index()
{
//dump(session('admin'));
try {
\think\Db::execute("SET @@sql_mode='';");
} catch (\Exception $e) {

View File

@@ -23,6 +23,7 @@ class Firmbigcategory extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmbigcategory;
$this->model->where('firm_id',session_admin_firm_id());
}

View File

@@ -4,6 +4,7 @@ namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
use think\Request;
/**
* 企业客户信息
@@ -24,6 +25,8 @@ class Firmcustomer extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmcustomer;
$this->view->assign("statusList", $this->model->getStatusList());
$this->model->where('firmcustomer.firm_id',session_admin_firm_id());
$this->model->where('firmcustomer.firmstore_id',session_admin_firmstore_id());
}
@@ -53,7 +56,7 @@ class Firmcustomer extends Backend
$list = $this->model
->with(['firmstoreprojectstwo','firmcustomerorigin','firmemployee'])
->where($where)
->where($where)
->order($sort, $order)
->paginate($limit);

View File

@@ -23,6 +23,8 @@ class Firmcustomerfollowuprecord extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmcustomerfollowuprecord;
$this->view->assign("statusList", $this->model->getStatusList());
$this->model->where('firm_id',session_admin_firm_id());
$this->model->where('firmstore_id',session_admin_firmstore_id());
}

View File

@@ -23,6 +23,8 @@ class Firmcustomerorigin extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmcustomerorigin;
$this->model->where('firm_id',session_admin_firm_id());
$this->model->where('firmstore_id',session_admin_firmstore_id());
}

View File

@@ -22,7 +22,8 @@ class Firmduty extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\Firmduty;
$this->model->where('firm_id',session_admin_firm_id());
$this->model->where('firmstore_id',session_admin_firmstore_id());
}

View File

@@ -24,6 +24,9 @@ class Firmemployee extends Backend
$this->model = new \app\admin\model\Firmemployee;
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("employeeTypeList", $this->model->getEmployeeTypeList());
$this->model->where('firmemployee.firm_id',session_admin_firm_id());
$this->model->where('firmemployee.firmstore_id',session_admin_firmstore_id());
}

View File

@@ -23,6 +23,8 @@ class Firmfollowuptemplate extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmfollowuptemplate;
$this->model->where('firmfollowuptemplate.firm_id',session_admin_firm_id());
$this->model->where('firmfollowuptemplate.firmstore_id',session_admin_firmstore_id());
}

View File

@@ -23,6 +23,7 @@ class Firmnotespoints extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmnotespoints;
$this->model->where('firm_id',session_admin_firm_id());
}

View File

@@ -23,6 +23,7 @@ class Firmstore extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmstore;
$this->model->where('firm_id',session_admin_firm_id());
}

View File

@@ -23,6 +23,8 @@ class Firmstoreprojectsone extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmstoreprojectsone;
$this->model->where('firm_id',session_admin_firm_id());
$this->model->where('firmstore_id',session_admin_firmstore_id());
}

View File

@@ -22,6 +22,8 @@ class Firmstoreprojectstwo extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\Firmstoreprojectstwo;
$this->model->where('firm_id',session_admin_firm_id());
$this->model->where('firmstore_id',session_admin_firmstore_id());
}

View File

@@ -22,6 +22,7 @@ class Firmtags extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\Firmtags;
$this->model->where('firm_id',session_admin_firm_id());
}