|
|
|
@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
namespace app\service; |
|
|
|
|
|
|
|
use app\model\User; |
|
|
|
|
|
|
|
class Service |
|
|
|
{ |
|
|
|
// msg
|
|
|
|
@ -15,36 +17,35 @@ class Service |
|
|
|
// 成功编码
|
|
|
|
public $sucCode = 0; |
|
|
|
// 软删除数据
|
|
|
|
public $delData; |
|
|
|
// 错误编码
|
|
|
|
public $errorCode = '50011'; |
|
|
|
|
|
|
|
public $listCacheKey; |
|
|
|
public $detailCacheKey; |
|
|
|
public $className; |
|
|
|
|
|
|
|
|
|
|
|
public $user; |
|
|
|
|
|
|
|
public $user_id; |
|
|
|
|
|
|
|
public $seller_id; |
|
|
|
|
|
|
|
protected $hidden = [ |
|
|
|
'password', 'seller_id' |
|
|
|
// 'password', 'seller_id'
|
|
|
|
]; |
|
|
|
|
|
|
|
public function __construct($data = []) |
|
|
|
{ |
|
|
|
$this->delData = [ |
|
|
|
'is_del' => 2, |
|
|
|
'delete_time' => time(), |
|
|
|
'update_time' => time(), |
|
|
|
]; |
|
|
|
|
|
|
|
$this->className = $this->getClassName(); |
|
|
|
$this->listCacheKey = $this->className . '_cache_list'; |
|
|
|
$this->detailCacheKey = $this->className . '_cache_detail'; |
|
|
|
|
|
|
|
$this->moveMsg = lang('移动成功'); |
|
|
|
$this->copyMsg = lang('复制成功'); |
|
|
|
$this->getMsg = lang('获取成功'); |
|
|
|
$this->addMsg = lang('添加成功'); |
|
|
|
$this->updateMsg = lang('修改成功'); |
|
|
|
$this->delMsg = lang('删除成功'); |
|
|
|
// parent::__construct($data);
|
|
|
|
$this->user = User::find(1); |
|
|
|
$this->user_id = $this->user->id; |
|
|
|
// $this->seller_id = $this->getSeller();
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function getClassName(): string |
|
|
|
@ -52,4 +53,5 @@ class Service |
|
|
|
$reflection = new \ReflectionClass($this); |
|
|
|
return $reflection->getShortName(); |
|
|
|
} |
|
|
|
|
|
|
|
} |