1
This commit is contained in:
parent
051a52cc86
commit
5b33deb2b9
@ -26,11 +26,13 @@ class SigningForm extends ApiModel
|
|||||||
|
|
||||||
public $attr_id;
|
public $attr_id;
|
||||||
|
|
||||||
|
public $order_id;
|
||||||
|
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['goods_hub_id', 'company_name', 'attr_id', 'brand_name', 'product', 'type', 'number'], 'required'],
|
[['goods_hub_id', 'company_name', 'attr_id', 'brand_name', 'product', 'type', 'number'], 'required'],
|
||||||
[['goods_hub_id', 'number', 'user_id'], 'integer'],
|
[['goods_hub_id', 'number', 'user_id', 'order_id'], 'integer'],
|
||||||
[['remark'], 'string']
|
[['remark'], 'string']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -56,9 +58,18 @@ class SigningForm extends ApiModel
|
|||||||
return $this->apiReturnError('商品id异常');
|
return $this->apiReturnError('商品id异常');
|
||||||
}
|
}
|
||||||
|
|
||||||
$signing = new Signing();
|
|
||||||
|
|
||||||
$signing->order_no = $this->orderNo();
|
if (!empty($this->order_id)) {
|
||||||
|
$signing = Signing::findOne(['id' => $this->order_id]);
|
||||||
|
if ($signing == null) {
|
||||||
|
return $this->apiReturnError('订单错误');
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$signing = new Signing();
|
||||||
|
$signing->order_no = $this->orderNo();
|
||||||
|
}
|
||||||
|
|
||||||
$signing->user_id = $this->user_id;
|
$signing->user_id = $this->user_id;
|
||||||
$signing->goods_id = $goods->id;
|
$signing->goods_id = $goods->id;
|
||||||
$signing->moy = $goodsAttr->price;
|
$signing->moy = $goodsAttr->price;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user