mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-24 14:04:07 +08:00
Fix uploading texture
This commit is contained in:
parent
19001b16dc
commit
5235ac23b0
@ -179,7 +179,6 @@ class SkinlibController extends Controller
|
||||
$t->size = ceil($request->file('file')->getSize() / 1024);
|
||||
$t->public = $request->input('public') == 'true';
|
||||
$t->uploader = $user->uid;
|
||||
$t->upload_at = get_datetime_string();
|
||||
|
||||
$cost = $t->size * ($t->public ? Option::get('score_per_storage') : Option::get('private_score_per_storage'));
|
||||
$cost += option('score_per_closet_item');
|
||||
|
@ -7,7 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Texture extends Model
|
||||
{
|
||||
public $primaryKey = 'tid';
|
||||
public $timestamps = false;
|
||||
public const CREATED_AT = 'upload_at';
|
||||
public const UPDATED_AT = null;
|
||||
|
||||
protected $casts = [
|
||||
'tid' => 'integer',
|
||||
|
32
database/migrations/2019_03_16_162603_remove_likes_field.php
Normal file
32
database/migrations/2019_03_16_162603_remove_likes_field.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveLikesField extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (Schema::hasColumn('textures', 'likes')) {
|
||||
Schema::table('textures', function (Blueprint $table) {
|
||||
$table->dropColumn('likes');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user