Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangtao
projecttwo
Commits
f7ac9a48
Commit
f7ac9a48
authored
Jun 11, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.11
parent
c33faeb5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
30 deletions
+125
-30
Settled.php
app/api/controller/Settled.php
+27
-12
Upload.php
app/api/controller/Upload.php
+0
-1
User.php
app/api/controller/User.php
+1
-0
BusinessValidate.php
app/api/validate/BusinessValidate.php
+17
-17
Business.php
app/model/project/Business.php
+36
-0
School.php
app/model/project/School.php
+44
-0
No files found.
app/api/controller/Settled.php
View file @
f7ac9a48
...
...
@@ -44,15 +44,21 @@ class Settled extends BaseController
return
$this
->
returnMsg
(
'token无效'
,
0
);
}
if
(
schoolModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
count
())
{
return
$this
->
returnMsg
(
'请勿重复提交'
,
0
);
}
//
if (schoolModel::where('user_id', $user['id'])->count())
//
{
//
return $this->returnMsg('请勿重复提交',0);
//
}
$data
[
'user_id'
]
=
$user
[
'id'
];
$affectedRows
=
schoolModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
count
();
if
(
$affectedRows
===
0
)
{
schoolModel
::
create
(
$data
);
}
else
{
schoolModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
update
(
$data
);
}
schoolModel
::
create
(
$data
);
userModel
::
where
(
'id'
,
$user
[
'id'
])
->
update
([
'role'
=>
3
]);
...
...
@@ -80,15 +86,22 @@ class Settled extends BaseController
return
$this
->
returnMsg
(
'token无效'
,
0
);
}
if
(
businessModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
count
())
{
return
$this
->
returnMsg
(
'请勿重复提交'
,
0
);
}
//
if (businessModel::where('user_id', $user['id'])->count())
//
{
//
return $this->returnMsg('请勿重复提交',0);
//
}
$data
[
'user_id'
]
=
$user
[
'id'
];
businessModel
::
create
(
$data
);
$affectedRows
=
businessModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
count
();
if
(
$affectedRows
===
0
)
{
businessModel
::
create
(
$data
);
}
else
{
businessModel
::
where
(
'user_id'
,
$user
[
'id'
])
->
update
(
$data
);
}
userModel
::
where
(
'id'
,
$user
[
'id'
])
->
update
([
'role'
=>
2
]);
...
...
@@ -111,7 +124,8 @@ class Settled extends BaseController
}
$data
=
schoolModel
::
where
([
'user_id'
=>
$user
[
'id'
]])
->
with
([
'schoolQualification'
,
'teacherQualification'
,
'agreement'
,
'moreFile'
])
->
append
([
'school_qualification_list'
,
'teacher_qualification_list'
,
'agreement_list'
,
'more_file_list'
])
// ->with(['schoolQualification','teacherQualification','agreement','moreFile'])
->
find
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$data
);
...
...
@@ -134,7 +148,8 @@ class Settled extends BaseController
}
$data
=
businessModel
::
where
([
'user_id'
=>
$user
[
'id'
]])
->
with
([
'businessQualification'
,
'businessIndustry'
,
'businessPorject'
,
'businessMore'
,
'businessLogo'
])
->
append
([
'business_qualification_list'
,
'business_industry_list'
,
'business_project_list'
,
'business_more_list'
])
->
with
([
'businessLogo'
])
->
find
();
return
$this
->
returnMsg
(
'操作成功'
,
1
,
$data
);
...
...
app/api/controller/Upload.php
View file @
f7ac9a48
...
...
@@ -117,7 +117,6 @@ class Upload extends BaseController
*/
public
function
upfile
(
string
$file
=
'file'
,
int
$groupid
=
0
,
string
$action
=
''
,
string
$thum
=
''
)
{
echo
222
;
exit
;
$action
=
$action
?
$action
:
input
(
'action'
);
if
(
!
$action
)
return
$this
->
returnMsg
(
'参数错误'
);
$this
->
init
();
...
...
app/api/controller/User.php
View file @
f7ac9a48
...
...
@@ -81,6 +81,7 @@ class User extends BaseController
$user
[
'salt'
]
=
random
(
4
);
$user
[
'password'
]
=
md5
(
$data
[
'password'
]
.
$user
[
'salt'
]);
$user
[
'reg_time'
]
=
time
();
$user
[
'create_time'
]
=
time
();
$user
[
'role'
]
=
$data
[
'role'
]
??
1
;
$res
=
userModel
::
insert
(
$user
);
if
(
!
$res
)
...
...
app/api/validate/BusinessValidate.php
View file @
f7ac9a48
...
...
@@ -16,10 +16,10 @@ class BusinessValidate extends BaseValidate
'web_url'
=>
'require'
,
'main_business'
=>
'require'
,
'about_business'
=>
'require'
,
'contacts_name'
=>
'require'
,
'job'
=>
'require'
,
'contacts_phone'
=>
'require'
,
'contacts_email'
=>
'require'
,
//
'contacts_name'=>'require',
//
'job'=>'require',
//
'contacts_phone'=>'require',
//
'contacts_email'=>'require',
'business_qualification_url_id'
=>
'require'
,
'business_industry_url_id'
=>
'require'
,
'business_project_url_id'
=>
'require'
,
...
...
@@ -27,19 +27,19 @@ class BusinessValidate extends BaseValidate
'more_url_id'
=>
'require'
,
'frxm'
=>
'require'
,
'qymc'
=>
'require'
,
'qydz'
=>
'require'
,
'qydm'
=>
'require'
,
'frsfz'
=>
'idCard'
,
//
'frxm' => 'require',
//
'qymc' => 'require',
//
'qydz' => 'require',
//
'qydm' => 'require',
//
'frsfz' => 'idCard',
];
protected
$message
=
[
'frxm.require'
=>
'法人姓名不能为空'
,
'qymc.require'
=>
'企业名称不能为空'
,
'qydm.require'
=>
'机构代码不能为空'
,
'qydz.require'
=>
'企业地址不能为空'
,
'frsfz.idCard'
=>
'法人身份证格式错误'
,
];
//
protected $message = [
//
'frxm.require' => '法人姓名不能为空',
//
'qymc.require' => '企业名称不能为空',
//
'qydm.require' => '机构代码不能为空',
//
'qydz.require' => '企业地址不能为空',
//
'frsfz.idCard' => '法人身份证格式错误',
//
//
];
}
\ No newline at end of file
app/model/project/Business.php
View file @
f7ac9a48
...
...
@@ -13,6 +13,42 @@ class Business extends Model
protected
$createTime
=
'create_time'
;
// 营业执照文件列表(原 businessQualification)
public
function
getBusinessQualificationListAttr
()
{
if
(
empty
(
$this
->
business_qualification_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
business_qualification_url_id
,
'list'
);
}
// 行业文件列表(原 businessIndustry)
public
function
getBusinessIndustryListAttr
()
{
if
(
empty
(
$this
->
business_industry_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
business_industry_url_id
,
'list'
);
}
// 项目文件列表(原 businessPorject)
public
function
getBusinessProjectListAttr
()
{
if
(
empty
(
$this
->
business_project_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
business_project_url_id
,
'list'
);
}
// 补充材料文件列表(原 businessMore)
public
function
getBusinessMoreListAttr
()
{
if
(
empty
(
$this
->
more_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
more_url_id
,
'list'
);
}
// 营业执照文件关联
public
function
businessQualification
()
{
...
...
app/model/project/School.php
View file @
f7ac9a48
...
...
@@ -13,6 +13,50 @@ class School extends Model
protected
$createTime
=
'create_time'
;
/**
* 学校资质文件列表
*/
public
function
getSchoolQualificationListAttr
()
{
if
(
empty
(
$this
->
school_qualification_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
school_qualification_url_id
,
'list'
);
}
/**
* 导师资质文件列表
*/
public
function
getTeacherQualificationListAttr
()
{
if
(
empty
(
$this
->
teacher_qualification_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
teacher_qualification_url_id
,
'list'
);
}
/**
* 合作协议文件列表
*/
public
function
getAgreementListAttr
()
{
if
(
empty
(
$this
->
agreement_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
agreement_url_id
,
'list'
);
}
/**
* 补充材料文件列表
*/
public
function
getMoreFileListAttr
()
{
if
(
empty
(
$this
->
more_url_id
))
{
return
[];
}
return
get_upload_file
(
$this
->
more_url_id
,
'list'
);
}
//学校资质id
public
function
schoolQualification
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment