Commit 748ffb7c authored by clone's avatar clone

bug

parent a240d34c
......@@ -104,9 +104,9 @@ class Register extends Basic
public function removeBinding()
{
$params = $this->params;
/* $params = array(
"buyer_id" => 1,
"user_id" => 12,
/* $params = array(
"buyer_id" => 5,
"user_id" => 25983,
);*/
$checkResult = $this->validate($params, "RegisterValidate.removeBind");
if (true !== $checkResult) {
......
......@@ -652,14 +652,13 @@ class Users extends Model
*/
public function unbundlingWx($params)
{
$where_ = [];
if (!isset($params["buyer_id"])) {
if (isset($params["buyer_id"])) {
$where_["buyer_id"] = $params["buyer_id"];
}else{//防止传入错误参数修改掉大面积数据此字段必填
return 0;
}
if (!isset($params["user_id"])) {
if (isset($params["user_id"])) {
$where_["id"] = $params["user_id"];
}
return $this->where($where_)->setField("buyer_id", 0);
......
......@@ -317,7 +317,7 @@ Route::group('api', [
'sendCode' => [ 'api/Register/registerSendCode', [ 'method' => 'POST' ] ],
'userVerify' => [ 'api/Register/registerVerify', [ 'method' => 'POST' ] ],
'removeBind' => [ 'api/Register/removeBinding', [ 'method' => 'POST' ] ],
'removeBind' => [ 'api/Register/removeBinding', [ 'method' => 'POST|GET' ] ],
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment