|
@@ -18,14 +18,19 @@ class DocterMessage extends BaseModel
|
|
$content = config('config.docter_message_map')[$type] ?? '';
|
|
$content = config('config.docter_message_map')[$type] ?? '';
|
|
$content = vsprintf($content, $param);
|
|
$content = vsprintf($content, $param);
|
|
}
|
|
}
|
|
- DocterMessage::create([
|
|
|
|
|
|
+ $add = [
|
|
'docter_id' => $docter_id,
|
|
'docter_id' => $docter_id,
|
|
'status' => 1,
|
|
'status' => 1,
|
|
'user_id' => $user_id,
|
|
'user_id' => $user_id,
|
|
'type' => $type,
|
|
'type' => $type,
|
|
'relation_id' => $relation_id,
|
|
'relation_id' => $relation_id,
|
|
'content' => $content,
|
|
'content' => $content,
|
|
- ]);
|
|
|
|
|
|
+ ];
|
|
|
|
+ if (in_array($type, [1,4])) {
|
|
|
|
+ $product_type = Order::where('id', $relation_id)->value('product_type');
|
|
|
|
+ $add['order_type'] = $product_type;
|
|
|
|
+ }
|
|
|
|
+ DocterMessage::create($add);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|