【发布时间】:2019-10-03 18:33:51
【问题描述】:
我正在orders 和order_status 表之间创建外键关系。当我从客户那里收到新订单并发货时,我将订单状态设置为在收到订单时发货。我设置了发货和收货状态,然后该订单将开始显示在订单历史记录页面上。我这样做对吗?
class CreateOrdersTable extends Migration
{
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('customer_name');
$table->string('customer_email');
$table->string('customer_contact');
$table->bigInteger('order_status_id')->unsigned();
$table->string('product_names');
$table->string('products_quantity');
$table->text('customer_address');
$table->timestamps();
});
}
这是 order_status 表:
class CreateOrderStatusTable extends Migration
{
public function up()
{
Schema::create('order_status', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('status')->nullable();
$table->timestamps();
});
}
}
【问题讨论】:
-
您的确切查询是什么?我们可以如何帮助您??
标签: php laravel laravel-5.8 laravel-6