Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
14aa8e1e
Commit
14aa8e1e
authored
Oct 08, 2016
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lvpaichengshi
parent
84ceca4b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
13 deletions
+15
-13
app/Sets/Listeners/SetsEditedListener.php
+0
-1
app/Sets/Listeners/SetsSearcherListener.php
+1
-1
app/Sets/Model/Category.php
+5
-1
app/Sets/Model/Promotion.php
+3
-3
app/Sets/Model/Sets.php
+6
-3
app/Sets/Validation/SetsValidator.php
+0
-4
No files found.
app/Sets/Listeners/SetsEditedListener.php
View file @
14aa8e1e
...
...
@@ -31,7 +31,6 @@ class SetsEditedListener
}
}
}
}
...
...
app/Sets/Listeners/SetsSearcherListener.php
View file @
14aa8e1e
...
...
@@ -42,7 +42,7 @@ class SetsSearcherListener
'sets_id'
=>
$model
->
id
,
'title'
=>
$model
->
title
,
'kw'
=>
$keyworks
,
'photographer_name'
=>
UserModel
::
getUserInfo
(
$model
->
uid
)
->
nickname
,
'photographer_name'
=>
UserModel
::
getUserInfo
(
$model
->
uid
,[
'nickname'
]
)
->
nickname
,
'lasttime'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'is_promotion'
=>
$model
->
is_promotion
,
'start_time'
=>
$model
->
start_time
,
...
...
app/Sets/Model/Category.php
View file @
14aa8e1e
...
...
@@ -30,7 +30,11 @@ class Category extends Model
parent
::
__construct
(
$attributes
);
if
(
isset
(
$attributes
[
'category_id'
])
&&
$attributes
[
'category_id'
]
>
0
)
{
$id
=
$attributes
[
'category_id'
];
$this
->
category_name
=
Cates
::
where
(
"id"
,
$id
)
->
first
()
->
category_name
;
try
{
$this
->
category_name
=
Cates
::
where
(
"id"
,
$id
)
->
first
()
->
category_name
;
}
catch
(
\Exception
$e
)
{
$this
->
category_name
=
" "
;
}
}
$this
->
beforeValidationOnCreate
();
}
...
...
app/Sets/Model/Promotion.php
View file @
14aa8e1e
...
...
@@ -15,7 +15,7 @@ class Promotion extends Model
{
use
Models
;
protected
$table
=
"myp_sets_promotion"
;
public
$timestamps
=
false
;
protected
$fillable
=
[
"promotion_price"
,
"promotion_start_time"
,
"promotion_end_time"
,
"per_user_count"
,
"city_id"
,
"is_del"
...
...
@@ -31,10 +31,10 @@ class Promotion extends Model
{
$this
->
is_del
=
0
;
$this
->
sort
=
0
;
$this
->
p_cost
_count
=
0
;
$this
->
p_cost
=
0
;
$this
->
p_lock
=
0
;
$this
->
p_sale
=
0
;
$this
->
p_total_sale
=
0
;
$this
->
p_order_count
=
0
;
}
...
...
app/Sets/Model/Sets.php
View file @
14aa8e1e
...
...
@@ -94,7 +94,7 @@ class Sets extends Model
$data
[
'temp_price'
]
=
$data
[
'price'
];
$model
->
fill
(
$data
)
->
save
();
//促销
if
(
isset
(
$data
[
'promotion'
]))
{
if
(
isset
(
$data
[
'promotion'
])
&&
$data
[
'is_promotion'
]
==
1
)
{
$models
=
Promotion
::
add
(
$data
[
'promotion'
]);
$model
->
relation_promotion
()
->
saveMany
(
$models
);
};
...
...
@@ -134,11 +134,14 @@ class Sets extends Model
$data
[
'temp_price'
]
=
$data
[
'price'
];
$this
->
update
(
$data
);
//促销
if
(
isset
(
$data
[
'promotion'
])
&&
!
empty
(
$data
[
'promotion'
]))
{
if
(
isset
(
$data
[
'promotion'
])
&&
!
empty
(
$data
[
'promotion'
])
&&
$data
[
'is_promotion'
]
==
1
)
{
$models
=
Promotion
::
add
(
$data
[
'promotion'
]);
$this
->
relation_promotion
()
->
update
([
'is_del'
=>
1
]);
$this
->
relation_promotion
()
->
saveMany
(
$models
);
};
}
elseif
(
$data
[
'is_promotion'
]
==
0
)
{
$this
->
relation_promotion
()
->
update
([
'is_del'
=>
1
]);
$this
->
update
([
'promotion_id'
=>
0
]);
}
//绑定的样片
if
(
isset
(
$data
[
'works'
])
&&
!
empty
(
$data
[
'works'
]))
{
$models
=
Works
::
add
(
$data
[
'works'
]);
...
...
app/Sets/Validation/SetsValidator.php
View file @
14aa8e1e
...
...
@@ -35,8 +35,6 @@ class SetsValidator extends Validator
'is_shelf'
=>
'required|in:0,1'
,
'change_descr'
=>
'required'
,
'other_descr'
=>
'required'
,
'travel_city_id'
=>
'required'
,
'travel_city_name'
=>
'required'
,
'abroad'
=>
'required|in:0,1'
,
'modeling_count_from_user'
=>
'required|min:0'
,
'is_promotion'
=>
"required|in:0,1"
...
...
@@ -81,9 +79,7 @@ class SetsValidator extends Validator
'change_descr.required'
=>
'改期说明必填'
,
'other_descr.required'
=>
'其它说明必填'
,
'service_city_id.required'
=>
'所属城市ID必填'
,
'travel_city_id.required'
=>
'旅拍城市ID必填'
,
'service_city_name.required'
=>
'所属城市名称必填'
,
'travel_city_name.required'
=>
'旅拍城市名称必填'
,
'modeling_count_from_user.required'
=>
'允许用户自带必填'
,
'negative_give_all.required'
=>
'摄影师提供数必填'
,
'is_shelf.required'
=>
'上下架状态必填'
,
...
...
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