new-admin-api/app/services/supplier/SystemSupplierApplyServices...

45 lines
1.0 KiB
PHP

<?php
namespace app\services\supplier;
use app\dao\supplier\SystemSupplierApplyDao;
use app\services\BaseServices;
use crmeb\exceptions\AdminException;
class SystemSupplierApplyServices extends BaseServices{
public function __construct(SystemSupplierApplyDao $dao){
$this->dao = $dao;
}
/**
* Common: 查询模型
* Author: wu-hui
* Time: 2024/01/30 14:46
* @param $where
* @return \crmeb\basic\BaseModel
*/
public function searchModel($where){
return $this->dao->searchModel($where);
}
/**
* Common: 添加申请信息
* Author: wu-hui
* Time: 2024/01/30 14:28
* @param array $data
* @return mixed
*/
public function createApplyInfo(array $data){
return $this->transaction(function() use ($data){
// 添加供应商信息
$relation_id = $this->dao->save($data['applyInfo'])->id;
if(!$relation_id) throw new AdminException('申请失败');
return $relation_id;
});
}
}