添加订单是否换货单标记
parent
d52fbb7ac8
commit
8e75b26beb
|
|
@ -53,6 +53,7 @@ class Order extends Model
|
|||
'pay_at' => 'datetime',
|
||||
'completed_at' => 'datetime',
|
||||
'status' => 'int',
|
||||
'is_change' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -80,6 +81,7 @@ class Order extends Model
|
|||
'shipping_state',
|
||||
'status',
|
||||
'completed_at',
|
||||
'is_change',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -355,6 +355,9 @@ class AfterSaleService
|
|||
$changeOrder->consignee_telephone = $order->consignee_telephone;
|
||||
$changeOrder->consignee_zone = $order->consignee_zone;
|
||||
$changeOrder->consignee_address = $order->consignee_address;
|
||||
|
||||
//标记是换货单
|
||||
$changeOrder->is_change = true;
|
||||
$changeOrder->save();
|
||||
|
||||
OrderProduct::create([
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddIsChangeToOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
//
|
||||
$table->unsignedTinyInteger('is_change')->default(0)->comment('是否是换货后生成的新订单');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
//
|
||||
$table->dropColumn('is_change');
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue