Product.php 583 字节
<?php
/**
 * @remark :
 * @name   :Product.php
 * @author :lyh
 * @method :post
 * @time   :2023/8/10 18:16
 */

namespace App\Models\ASide;

use App\Models\Base;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;

class Product extends Base
{
    protected $table = 'gl_product';

    const STATUS_ON = 1;
    public static function getNumByProjectId($project_id){
        ProjectServer::useProject($project_id);
        return DB::connection('custom_mysql')->table('gl_product')->where('project_id', $project_id)->where('status', self::STATUS_ON)->count();
    }
}