|
@@ -79,9 +79,12 @@ class InvoiceOrder extends Base{
|
|
|
|
|
|
public static function onBeforeDelete($model){
|
|
|
$id=$model->id;
|
|
|
+ Log::info('InvoiceOrder数据:onBeforeDelete:'.json_encode($model->id,JSON_UNESCAPED_UNICODE));
|
|
|
$info = InvoiceOrder::where(['id'=>$id])->findOrEmpty();
|
|
|
- if(!$info->isEmpty())return ;
|
|
|
+ Log::info('InvoiceOrder数据:onBeforeDelete'.json_encode($info->toArray(),JSON_UNESCAPED_UNICODE));
|
|
|
+ if($info->isEmpty())return ;
|
|
|
if(in_array($info->status,[1,2])) self::orderOut($info->code,bcsub($info->total_amount,$info->balance_amount,2));
|
|
|
+ Log::info('InvoiceOrder数据:onBeforeDelete:'.InvoiceOrder::getLastsql());
|
|
|
}
|
|
|
//订单关联初始化金额
|
|
|
public static function orderIn($code,$fee){
|