|
@@ -287,4 +287,32 @@ class Join extends Api
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 账户注销-提交
|
|
|
+ * @ApiMethod (POST)
|
|
|
+ * @ApiParams (name=logout_reason,type="string", required=true,description="账户注销理由")
|
|
|
+ * @ApiParams (name=logout_type,type="string", required=true,description="类型:1=塘主,2=渔场主")
|
|
|
+ */
|
|
|
+ public function user_logout()
|
|
|
+ {
|
|
|
+ $logout_reason = $this->request->post('logout_reason');
|
|
|
+ $logout_type = $this->request->post('logout_type');
|
|
|
+ if ($logout_reason == "" || $logout_type == '') {
|
|
|
+ $this->error(__('Invalid parameters'));
|
|
|
+ }
|
|
|
+
|
|
|
+ $suppliers_model = new Fishery();
|
|
|
+ // 检查申请信息
|
|
|
+ $info = $suppliers_model::get(['user_id' => $this->auth->id, 'type' => $logout_type, 'status' => 2]);
|
|
|
+ if (!$info) {
|
|
|
+ $this->error('申请信息不存在');
|
|
|
+ }
|
|
|
+
|
|
|
+ $info->logout = 1;
|
|
|
+ $info->logout_reason = $logout_reason;
|
|
|
+ $info->logout_status = 1;
|
|
|
+ $info->save();
|
|
|
+
|
|
|
+ $this->success('成功');
|
|
|
+ }
|
|
|
}
|