|
@@ -312,6 +312,11 @@ class Orders extends Model
|
|
|
self::afterInsert(function (self $orders){
|
|
|
#添加发票
|
|
|
UserTax::fromOrder($orders);
|
|
|
+ #合同链接
|
|
|
+ $contract_link=request()->root()."/contract/view/show/{$orders['id']}";
|
|
|
+ $orders->where('id',$orders['id'])->update([
|
|
|
+ 'contract_link'=>$contract_link,
|
|
|
+ ]);
|
|
|
});
|
|
|
self::beforeUpdate(function (self $order){
|
|
|
$data=$order->getChangedData();
|