feat : coupon
This commit is contained in:
@@ -17,6 +17,7 @@ use Hyperf\DbConnection\Model\Model;
|
|||||||
* @property int $cycle_id
|
* @property int $cycle_id
|
||||||
* @property int $site_id
|
* @property int $site_id
|
||||||
* @property int $city_id
|
* @property int $city_id
|
||||||
|
* @property int $kitchen_id
|
||||||
* @property int $coupon_id
|
* @property int $coupon_id
|
||||||
* @property int $copies
|
* @property int $copies
|
||||||
* @property int $type
|
* @property int $type
|
||||||
@@ -52,7 +53,7 @@ class Order extends Model
|
|||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*/
|
*/
|
||||||
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'cycle_id' => 'integer', 'site_id' => 'integer', 'city_id' => 'integer', 'coupon_id' => 'integer', 'meal_copies' => 'integer', 'optional_copies' => 'integer', 'status' => 'integer', 'is_refund_all' => 'integer'];
|
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'cycle_id' => 'integer', 'site_id' => 'integer', 'city_id' => 'integer', 'coupon_id' => 'integer', 'meal_copies' => 'integer', 'optional_copies' => 'integer', 'status' => 'integer', 'is_refund_all' => 'integer','kitchen_id' => 'integer'];
|
||||||
|
|
||||||
const string CREATED_AT = 'create_time';
|
const string CREATED_AT = 'create_time';
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class OrderListService extends BaseService
|
|||||||
{
|
{
|
||||||
$limit = (int)$this->request->input('limit', 20);
|
$limit = (int)$this->request->input('limit', 20);
|
||||||
|
|
||||||
//todo where
|
//todo where kitchenID
|
||||||
$orderList = $this->orderModel
|
$orderList = $this->orderModel
|
||||||
->when($this->request->input('search_user_id'), function ($query) {
|
->when($this->request->input('search_user_id'), function ($query) {
|
||||||
$query->where('user_id', $this->request->input('search_user_id'));
|
$query->where('user_id', $this->request->input('search_user_id'));
|
||||||
@@ -62,6 +62,9 @@ class OrderListService extends BaseService
|
|||||||
->when($this->request->input('search_status'), function ($query) {
|
->when($this->request->input('search_status'), function ($query) {
|
||||||
$query->where('status', $this->request->input('search_status'));
|
$query->where('status', $this->request->input('search_status'));
|
||||||
})
|
})
|
||||||
|
->when($this->request->input('city_id'), function ($query) {
|
||||||
|
$query->where('city_id', $this->request->input('city_id'));
|
||||||
|
})
|
||||||
->select([
|
->select([
|
||||||
'id',
|
'id',
|
||||||
'cycle_id',
|
'cycle_id',
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ class PlaceOrderService extends BaseOrderService
|
|||||||
$orderInsertModel->cycle_id = $this->cycleId;
|
$orderInsertModel->cycle_id = $this->cycleId;
|
||||||
$orderInsertModel->site_id = $this->siteId;
|
$orderInsertModel->site_id = $this->siteId;
|
||||||
$orderInsertModel->city_id = $this->orderRes['site_info']['city_id'];
|
$orderInsertModel->city_id = $this->orderRes['site_info']['city_id'];
|
||||||
|
$orderInsertModel->kitchen_id = $this->orderRes['site_info']['kitchen_id'];
|
||||||
$orderInsertModel->coupon_id = $this->couponId;
|
$orderInsertModel->coupon_id = $this->couponId;
|
||||||
$orderInsertModel->copies = $this->orderRes['copies'];
|
$orderInsertModel->copies = $this->orderRes['copies'];
|
||||||
$orderInsertModel->type = $this->orderType;
|
$orderInsertModel->type = $this->orderType;
|
||||||
|
|||||||
Reference in New Issue
Block a user