Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
565f35ab
Commit
565f35ab
authored
Oct 25, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8de0928f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
47 deletions
+18
-47
common/modules/bids/controllers/BidController.php
common/modules/bids/controllers/BidController.php
+18
-47
No files found.
common/modules/bids/controllers/BidController.php
View file @
565f35ab
...
...
@@ -36,19 +36,13 @@ class BidController extends \common\components\BaseController
$model
=
new
Bid
;
$model
->
scenario
=
Yii
::
$app
->
request
->
post
(
'scenario'
);
if
(
Yii
::
$app
->
request
->
isAjax
&&
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
if
(
Yii
::
$app
->
request
->
isAjax
&&
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
if
(
$model
->
save
())
{
try
{
if
(
$model
->
save
())
{
// Yii::$app->user->identity->afterSubscribe(12);
if
(
$model
->
file
)
{
foreach
(
$model
->
file
as
$filename
)
{
if
(
$model
->
file
)
{
foreach
(
$model
->
file
as
$filename
)
{
$file
=
new
BidFile
;
$file
->
bid_id
=
$model
->
id
;
$file
->
filename
=
$filename
;
...
...
@@ -58,24 +52,17 @@ class BidController extends \common\components\BaseController
}
$model
->
send
();
$transaction
->
commit
();
return
[
'success'
=>
true
];
}
else
{
}
else
{
return
ActiveForm
::
validate
(
$model
);
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$transaction
->
rollBack
();
throw
$e
;
}
}
else
{
}
else
{
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
}
}
...
...
@@ -92,19 +79,12 @@ class BidController extends \common\components\BaseController
$model
=
new
Bid
;
$model
->
blog
=
true
;
$model
->
scenario
=
Yii
::
$app
->
request
->
post
(
'scenario'
);
if
(
Yii
::
$app
->
request
->
isAjax
&&
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
if
(
Yii
::
$app
->
request
->
isAjax
&&
$model
->
load
(
Yii
::
$app
->
request
->
post
()))
{
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
if
(
$model
->
save
())
{
// Yii::$app->user->identity->afterSubscribe(12);
if
(
$model
->
file
)
{
foreach
(
$model
->
file
as
$filename
)
{
try
{
if
(
$model
->
save
())
{
if
(
$model
->
file
)
{
foreach
(
$model
->
file
as
$filename
)
{
$file
=
new
BidFile
;
$file
->
bid_id
=
$model
->
id
;
$file
->
filename
=
$filename
;
...
...
@@ -114,24 +94,17 @@ class BidController extends \common\components\BaseController
}
$model
->
send
();
$transaction
->
commit
();
return
[
'success'
=>
true
];
}
else
{
}
else
{
return
ActiveForm
::
validate
(
$model
);
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$transaction
->
rollBack
();
throw
$e
;
}
}
else
{
}
else
{
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
}
}
...
...
@@ -144,10 +117,8 @@ class BidController extends \common\components\BaseController
$model
=
new
BidFile
;
$model
->
file
=
UploadedFile
::
getInstanceByName
(
'file'
);
if
(
$model
->
file
)
{
if
(
!
file_exists
(
BidFile
::
path
()))
{
if
(
$model
->
file
)
{
if
(
!
file_exists
(
BidFile
::
path
()))
{
mkdir
(
BidFile
::
path
(),
0777
,
true
);
}
...
...
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