小编Pra*_*eek的帖子

在MySQL数据库中存储性别的最佳技术

哪种方法可以在MY SQL数据库中存储性别?我对这个问题感到有点困惑,因为不同的人以不同的方式表达.有人建议将它存储在INT中更好,但是其他人建议使用TINYINTEnum,但是其他人建议将它存储在CHAR(1)M for Male和F For Female中.

此外,在听到http://en.wikipedia.org/wiki/ISO_5218时会更加令人怀疑

但是在我看来将它存储在CHAR中是一个好主意,因为它提供了比ENUM更强大的功能?我也关注可伸缩性,想知道存储数百万条记录的更好解决方案.

非常感谢专家提出的宝贵建议.

mysql database sqldatatypes

6
推荐指数
2
解决办法
1万
查看次数

如何在同一位置传递不同的动态参数来访问laravel中的不同视图页面

这些是我遇到问题的路线

获取特定城市注册地点列表的路由

例如: http://localhost:8000/London , http://localhost:8000/London/Restaurants

Route::group(['namespace' => 'Page'], function() {
    Route::group(['prefix' => '{city}', 'where'  => ['city' => '[\w\d]+']], function() {
        Route::get('/', 'CityPageController@showCityPage')->name('cityPage');
    });
});
Run Code Online (Sandbox Code Playgroud)

获取特定用户个人资料及其详细信息(例如评论、照片等)的路由。

例如: http://localhost:8000/Johnhttp://localhost:8000/John/reviewshttp://localhost:8000/John/photos

Route::group(['namespace' => 'User'], function() {
    Route::group(['middleware' => 'verified'], function() {
        Route::group(['prefix' => '{username}', 'where'  => ['username' => '[\w\d]+']], function() {
            Route::get('/', 'ProfileController@showProfilePage')->name('profilePage');
            Route::get('/reviews', 'ReviewController@showReviewPage')->name('reviewPage');
            Route::get('/photos', 'ImageController@showPhotoPage')->name('photoPage');
        });
    });
});
Run Code Online (Sandbox Code Playgroud)

问题是这两条路线不能同时工作。

位于另一条路线之上的路线优先于另一条路线。

如何解决这个路由问题。

编辑

我知道有一种方法可以实现此功能,但我不知道如何实现。任何帮助表示赞赏。

routing laravel laravel-routing laravel-route

5
推荐指数
2
解决办法
237
查看次数

Jquery Crop:裁剪器图像没有改变

我有以下代码:

<link rel="stylesheet" href="style.css">
<script src="/static/js/jquery/2.1.4/jquery.min.js"></script>
<script src="http://fengyuanchen.github.io/cropper/js/cropper.min.js"></script>
<form  action="" method="post" enctype="multipart/form-data">
<img id="crop" style="width:400px;height:200px;" />
<div id="img2" style="position: relative; overflow: hidden; border: 1px solid #000; background: #fff; width: 100px; height: 100px;"></div>
X: <input type="text" id="crop_x" name="crop_x" /><br />
Y: <input type="text" id="crop_y" name="crop_y" /><br />
Width: <input type="text" id="crop_width" name="crop_width" /><br />
Height: <input type="text" id="crop_height" name="crop_height" /><br />
<input type="file" id="file" name="file" />
<input type="submit" id="submit" name="submit" value="Submit" />
</form>
<script>

var url = null;
$('#file').on('change',function(){

    var file …
Run Code Online (Sandbox Code Playgroud)

javascript jquery crop cropper

3
推荐指数
1
解决办法
6981
查看次数

如何在 Laravel 中使用 jQuery ajax 请求自动添加 X-CSRF-TOKEN

如何在我的 Laravel 应用程序的 ajax 请求(GET 或 POST)中自动添加 csrf 令牌,而无需手动将其添加到每个请求中。

我的ajax请求

   $.ajax({
      type:'post',
      url: "/email/unique",
      data: { "_token": "{{ csrf_token() }}", "email": email }
      success: function(data) {
        console.log(data);
      }
   });
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery laravel csrf-token

2
推荐指数
1
解决办法
4677
查看次数

如何在div标签内包裹的span元素之间增加间距?

我有一个div具有多个span元素的父元素作为子元素。的span元件被缠绕到内新线div元件。但是我试图span在第一行和第二行之间增加一些垂直间距。我试图添加边距作为

margin-bottom: 4px;

margin: 4px 0px 4px 0px;

但两种选择都不起作用。

<div style="width: 200px;">
    <span style="border:2px solid red; margin-bottom:4px;"> text 1 </span>
    <span style="border:2px solid red; margin-bottom:4px;"> text 2 </span>
    <span style="border:2px solid red; margin-bottom:4px;"> text 888888 888888 888 888  8  8888 8 8 888 888 8888 888  88888  8888 888 8888 8888 8888 </span>
    <span style="border:2px solid red; margin-bottom:4px;"> text 4 </span>
    <span style="border:2px solid red; margin-bottom:4px;"> text5 </span>
    <span …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
1425
查看次数