订单增加已发货状态
parent
516773d54d
commit
ba2f05cb64
|
|
@ -14,8 +14,8 @@ class OrderFilter extends ModelFilter
|
||||||
$this->where('status', Order::STATUS_PENDING);
|
$this->where('status', Order::STATUS_PENDING);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'paid':
|
case 'unreceived':
|
||||||
$this->where('status', Order::STATUS_PAID);
|
$this->where('status', [Order::STATUS_PAID, Order::STATUS_SHIPPED]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'completed':
|
case 'completed':
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,10 @@ class Order extends Model
|
||||||
{
|
{
|
||||||
use Filterable;
|
use Filterable;
|
||||||
|
|
||||||
public const STATUS_PENDING = 0; // 待付款
|
public const STATUS_PENDING = 0; // 待付款
|
||||||
public const STATUS_PAID = 1; // 已付款
|
public const STATUS_PAID = 1; // 已付款
|
||||||
public const STATUS_COMPLETED = 9; // 已完成
|
public const STATUS_SHIPPED = 2; // 已发货
|
||||||
|
public const STATUS_COMPLETED = 9; // 已完成
|
||||||
public const STATUS_CANCELLED = 10; // 已取消
|
public const STATUS_CANCELLED = 10; // 已取消
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ class CreateOrdersTable extends Migration
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
$table->unique('sn');
|
$table->unique('sn');
|
||||||
|
$table->index(['user_id', 'status']);
|
||||||
|
$table->index('status');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddCouponAmountToUserCouponsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('user_coupons', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
$table->dropColumn('coupon_value');
|
|
||||||
$table->unsignedInteger('coupon_amount')->default(0)->comment('抵扣金额:分/折扣(100)');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('user_coupons', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue