订单增加已发货状态
parent
516773d54d
commit
ba2f05cb64
|
|
@ -14,8 +14,8 @@ class OrderFilter extends ModelFilter
|
|||
$this->where('status', Order::STATUS_PENDING);
|
||||
break;
|
||||
|
||||
case 'paid':
|
||||
$this->where('status', Order::STATUS_PAID);
|
||||
case 'unreceived':
|
||||
$this->where('status', [Order::STATUS_PAID, Order::STATUS_SHIPPED]);
|
||||
break;
|
||||
|
||||
case 'completed':
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@ class Order extends Model
|
|||
{
|
||||
use Filterable;
|
||||
|
||||
public const STATUS_PENDING = 0; // 待付款
|
||||
public const STATUS_PAID = 1; // 已付款
|
||||
public const STATUS_COMPLETED = 9; // 已完成
|
||||
public const STATUS_PENDING = 0; // 待付款
|
||||
public const STATUS_PAID = 1; // 已付款
|
||||
public const STATUS_SHIPPED = 2; // 已发货
|
||||
public const STATUS_COMPLETED = 9; // 已完成
|
||||
public const STATUS_CANCELLED = 10; // 已取消
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ class CreateOrdersTable extends Migration
|
|||
$table->timestamps();
|
||||
|
||||
$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