批量修改密码 以及销售信息修改

This commit is contained in:
“wanyongkang”
2025-06-13 15:10:26 +08:00
parent 392b680e75
commit 28f4dcce32
2 changed files with 37 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace app\product\controller;
use fastphp\base\Controller;
use app\product\model\ProductAccount as AccountModel;
class Account extends Controller
{
public function updatePasswd(){
$data = json_decode(file_get_contents("php://input"),true);
if(!$data){
die;
}
$where = [
'ProductId' => $data['productId'],
'DeleteTag' => 0,
'Account' => ['IN', explode(',', $data['accounts'])]
];
$account_model = new AccountModel;
$account_model->updateOne($where, ['Pwd' => $data['pwd']]);
if ($data['productId'] == 18) {
$url = "http://rds-api.juip.com/api/agent/changeManyPasswd/accts/".$data['accounts'].'/pass/'.$data['pwd'];
} elseif ($data['productId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/changeManyPasswd/apikey/80cf4f64e990b78a9fc5eb/accts/".$data['accounts'].'/pass/'.$data['pwd'];
} elseif ($data['productId'] == 3 || $data['productId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/changeManyPasswd/apikey/80cf4f64e990b78a9fc5eb/accts/".$data['accounts'].'/pass/'.$data['pwd'];
}
linkcurl($url,'GET',[],[],0);
echo json_encode(['Code'=>10000,]);
}
}