|
@@ -302,6 +302,30 @@ class ChatController extends BaseController
|
|
|
|
|
|
$model = WxContRepositories::add($uid, $oid, $chat_content, $chat_image, $chat_audio_url, $chat_audio_length, $refer_id, 0, 0, $shop_good_id, null, 0, $voter_id,$ask_order_id); //通用聊天
|
|
|
|
|
|
+ //付费咨询的逻辑
|
|
|
+ if($model){
|
|
|
+ if($ask_order_id){
|
|
|
+ //如果是答主的第一句话,倒计时开始
|
|
|
+ $ask_order = DB::table('ask_order')->where('status',10)->where('id',$ask_order_id)->first();
|
|
|
+ if($ask_order){
|
|
|
+ $blogger_chat = DB::table('wx_chat')->where([
|
|
|
+ ['user_id','=',$ask_order->blogger_user_id],
|
|
|
+ ['object_id','=',$ask_order->user_id],
|
|
|
+ ['expand_type','=',9],
|
|
|
+ ['expand_id','=',$ask_order_id],
|
|
|
+ ])->count();
|
|
|
+ if($blogger_chat == 1){
|
|
|
+ $countdown_time = $ask_order->ask_minute * 60 + time(); //倒计时时间
|
|
|
+ DB::table('ask_order')->where('status',10)->where('id',$ask_order_id)->update([
|
|
|
+ 'status' => 15, //已回复
|
|
|
+ 'countdown_time' => $countdown_time, //倒计时
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if($model){
|
|
|
$websocket_id = GatewayUtils::uid2client_id($oid);
|
|
|
if($websocket_id){
|