作者 lyh

gx

@@ -13,22 +13,20 @@ class Product extends Base @@ -13,22 +13,20 @@ class Product extends Base
13 { 13 {
14 //设置关联表名 14 //设置关联表名
15 protected $table = 'gl_product'; 15 protected $table = 'gl_product';
16 - //连接数据库  
17 - protected $connection = '';  
18 const STATUS_DRAFT = 0; 16 const STATUS_DRAFT = 0;
19 const STATUS_ON = 1; 17 const STATUS_ON = 1;
20 const STATUS_RECYCLE = 2; 18 const STATUS_RECYCLE = 2;
  19 +
  20 + protected $connection;
21 21
22 public function __construct($project_id) 22 public function __construct($project_id)
23 { 23 {
24 - // 设置数据信息  
25 $project = ProjectServer::useProject($project_id); 24 $project = ProjectServer::useProject($project_id);
26 if(empty($project)){ 25 if(empty($project)){
27 return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'数据库未配置']); 26 return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'数据库未配置']);
28 } 27 }
29 $this->connection = 'custom_mysql'; 28 $this->connection = 'custom_mysql';
30 } 29 }
31 -  
32 public static function statusMap(){ 30 public static function statusMap(){
33 return [ 31 return [
34 self::STATUS_DRAFT => '草稿', 32 self::STATUS_DRAFT => '草稿',