|
...
|
...
|
@@ -20,7 +20,7 @@ class Product extends Base |
|
|
|
//设置关联表名
|
|
|
|
protected $table = 'gl_product';
|
|
|
|
//连接数据库
|
|
|
|
// protected $connection = 'custom_mysql';
|
|
|
|
protected $connection = 'custom_mysql';
|
|
|
|
const STATUS_DRAFT = 0;
|
|
|
|
const STATUS_ON = 1;
|
|
|
|
const STATUS_RECYCLE = 2;
|
|
...
|
...
|
@@ -154,8 +154,6 @@ class Product extends Base |
|
|
|
// }
|
|
|
|
|
|
|
|
public static function getNumByProjectId($project_id){
|
|
|
|
$project = ProjectServer::useProject($project_id);
|
|
|
|
DB::connection('custom_mysql')->reconnect(); // 连接到目标数据库
|
|
|
|
return self::where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|