add option for score consumption of adding to closet
This commit is contained in:
parent
f31bd85445
commit
da7a0ac606
|
|
@ -57,7 +57,12 @@ class AdminController extends Controller
|
||||||
$group->addon('积分 = 1 KB');
|
$group->addon('积分 = 1 KB');
|
||||||
})->hint('上传私密材质将消耗更多积分');
|
})->hint('上传私密材质将消耗更多积分');
|
||||||
|
|
||||||
$form->checkbox('return_score', '积分返还', '用户删除角色/材质时返还积分');
|
$form->group('score_per_closet_item', '收藏消耗积分', function($group) {
|
||||||
|
$group->text('score_per_closet_item');
|
||||||
|
$group->addon('积分 = 一个衣柜物品');
|
||||||
|
});
|
||||||
|
|
||||||
|
$form->checkbox('return_score', '积分返还', '用户删除角色/材质/收藏时返还积分');
|
||||||
|
|
||||||
$form->group('score_per_player', '角色', function($group) {
|
$form->group('score_per_player', '角色', function($group) {
|
||||||
$group->text('score_per_player');
|
$group->text('score_per_player');
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@ class ClosetController extends Controller
|
||||||
'name' => 'required|no_special_chars'
|
'name' => 'required|no_special_chars'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (app('user.current')->getScore() < option('score_per_closet_item', null, false)) {
|
||||||
|
return json(trans('user.closet.add.lack-score'), 7);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->closet->add($request->tid, $request->name)) {
|
if ($this->closet->add($request->tid, $request->name)) {
|
||||||
$t = Texture::find($request->tid);
|
$t = Texture::find($request->tid);
|
||||||
$t->likes += 1;
|
$t->likes += 1;
|
||||||
|
|
|
||||||
|
|
@ -343,8 +343,8 @@ class OptionFormGroup
|
||||||
$rendered = [];
|
$rendered = [];
|
||||||
|
|
||||||
foreach ($this->items as $item) {
|
foreach ($this->items as $item) {
|
||||||
if ($item['id'] && !$item['value']) {
|
if ($item['id'] && is_null($item['value'])) {
|
||||||
$item['value'] = option($item['id']);
|
$item['value'] = option($item['id'], null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rendered[] = view('vendor.option-form.'.$item['type'])->withId($item['id'])->withValue($item['value']);
|
$rendered[] = view('vendor.option-form.'.$item['type'])->withId($item['id'])->withValue($item['value']);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* @Author: printempw
|
* @Author: printempw
|
||||||
* @Date: 2016-07-29 11:53:11
|
* @Date: 2016-07-29 11:53:11
|
||||||
* @Last Modified by: printempw
|
* @Last Modified by: printempw
|
||||||
* @Last Modified time: 2016-12-27 22:56:31
|
* @Last Modified time: 2016-12-28 12:59:37
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
@ -39,5 +39,6 @@ return [
|
||||||
'force_ssl' => '0',
|
'force_ssl' => '0',
|
||||||
'auto_detect_asset_url' => '1',
|
'auto_detect_asset_url' => '1',
|
||||||
'plugins_enabled' => '',
|
'plugins_enabled' => '',
|
||||||
'copyright_prefer' => '0'
|
'copyright_prefer' => '0',
|
||||||
|
'score_per_closet_item' => '0'
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ closet:
|
||||||
add:
|
add:
|
||||||
success: Added :name to closet successfully~
|
success: Added :name to closet successfully~
|
||||||
repeated: You have already added this texture.
|
repeated: You have already added this texture.
|
||||||
|
lack-score: You don't have enough score to add it to closet.
|
||||||
|
|
||||||
rename:
|
rename:
|
||||||
title: Rename item
|
title: Rename item
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ closet:
|
||||||
add:
|
add:
|
||||||
success: 材质 :name 收藏成功~
|
success: 材质 :name 收藏成功~
|
||||||
repeated: 你已经收藏过这个材质啦
|
repeated: 你已经收藏过这个材质啦
|
||||||
|
lack-score: 积分不够添加收藏啦
|
||||||
|
|
||||||
rename:
|
rename:
|
||||||
title: 重命名物品
|
title: 重命名物品
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user