|
@@ -119,7 +119,34 @@ class AskController extends BaseController
|
|
|
|
|
|
}
|
|
|
|
|
|
- //结束此次咨询
|
|
|
+ //结束此次咨询,用户或答主都可操作
|
|
|
+ public function finish(){
|
|
|
+ //
|
|
|
+ $order_id = _empty_default_($request->order_id,0);
|
|
|
+
|
|
|
+ $order = DB::table('ask_order')->where('id',$order_id)->where('status','>',0)
|
|
|
+// ->where('user_id',$request->uid)
|
|
|
+ ->orWhere(function($query) {
|
|
|
+ $query->where('user_id', $request->uid)
|
|
|
+ ->where('blogger_user_id', $request->uid);
|
|
|
+ })
|
|
|
+ ->first();
|
|
|
+ if(empty($order)){
|
|
|
+ return $this->fail(200016,[],'没有找到该咨询');
|
|
|
+ }
|
|
|
+ if($order->status == 20){
|
|
|
+ return $this->fail(200016,[],'咨询已经结束了');
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ $update = [
|
|
|
+ 'status' => 20,
|
|
|
+ 'finish_time' => time(),
|
|
|
+ ];
|
|
|
+ DB::table('ask_order')->where('id',$order_id)->update($update);
|
|
|
+
|
|
|
+ return $this->success();
|
|
|
+ }
|
|
|
|
|
|
//旁听
|
|
|
public function sit(Request $request){
|