EnterpriseProductLogic.php 1.3 KB
<?php
/**
 * @remark :
 * @name   :EnterpriseProductLogic.php
 * @author :lyh
 * @method :post
 * @time   :2025/3/26 10:10
 */

namespace App\Http\Logic\Aside\Project;

use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\EnterpriseProduct;

/**
 * @remark :企业产品库
 * @name   :EnterpriseProductLogic
 * @author :lyh
 * @method :post
 * @time   :2025/3/26 10:13
 */
class EnterpriseProductLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();
        $this->model = new EnterpriseProduct();
        $this->param = $this->requestAll;
    }

    /**
     * @remark :保存产品企业库
     * @name   :saveEnterpriseProduct
     * @author :lyh
     * @method :post
     * @time   :2025/3/26 10:17
     */
    public function saveEnterpriseProduct(){
        $saveData = [];
        foreach ($this->param['data'] as $k => $v){
            if($k < 1){
                continue;
            }
            $saveData[] = [
                'title'=>$v[0],
                'image'=>$v[1],
                'url'=>$v[2],
                'project_id'=>$this->param['project_id'],
                'keywords'=>$v[3],
                'release_at'=>$v[4],
            ];
        }
        return $this->model->insertAll($saveData);
    }
}