<?php
namespace app\api\logic;
use app\common\logic\BaseLogic;
use app\common\model\firm\FirmRegister;

/**
 * @author 林海涛
 * @date 2024/7/12 下午2:28
 */
class FirmLogic  extends BaseLogic
{

   public static function register($params,$userId)
   {
       try {
           FirmRegister::create([
               'firm_name' => $params['firm_name'],
               'user_name' => $params['user_name'],
               'mobile' => $params['mobile'],
               'address' => $params['address'],
               'cooperate_description' => $params['cooperate_description'],
               'user_id' => $userId
           ]);
           return true;
       } catch (\Exception $e) {
           self::setError($e->getMessage());
           return false;
       }
   }
}