亲爱的小伙伴, 再8-13 门店管理本节中如果您的PHP版本是7.0以上的话,
再 app\bis\controller\Location.php文件中的
$bisId = $this->getLoginUser()->bis_id;
会有如下得报错信息:
Fatal error: app\bis\controller\Location::add(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "app\common\model\BisAccount" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition
php5不会存在这个问题, 我们需要做下修改:
修改方案如下:
1、找到:
app\bis\controller\Login.php
2、再定位到index方法
把
$ret = model('BisAccount')->get(['username'=>$data['username']])修改为:
$ret = model('BisAccount')->get(['username'=>$data['username']])->toArray(); 转化为数组,
然后把之前代码中获取对象里面的值 比如 $ret->status 修改为 $ret['status']
其他的自行修改
3、然后在定位到 app\bis\controller\Location.php
$bisId = $this->getLoginUser()->bis_id; 修改为 : $bisId = $this->getLoginUser()['bis_id'];
就没问题了。