- 小商店的库存无法更新
小商店库存无法更新,接口不生效,不报错 $url_kc = "https://api.weixin.qq.com/product/stock/update?access_token=".$access_token; //更新库存 $arr_kc=array("product_id"=> 86475679,"sku_id"=>"316621211","type"=>2,"stock_num"=> 100); //增加100的库存 $data_kc = json_encode($arr_kc,JSON_UNESCAPED_UNICODE); $res_kc=http_request($url_kc, $data_kc); print_r($res_kc); POST请求包体 {"product_id":86475679,"sku_id":"316621211","type":2,"stock_num":100} 返回以下数据,但是库存没有更新成功 {"errcode":0,"data":{"update_time":"2022-04-27 17:12:57"}}
2022-04-27 - 交易组件绑定对公帐户失败,无法获取
[图片]
2022-04-06 - 通讯录新增用户的时候,名称乱码,请问怎么处理?
[图片] name字段,一直是这样子,没法显示中文 function add_user($access_token,$userid, $name,$mobile,$bmmc)//更新员工,提供token,帐号,姓名,手机号,部门名称 { $url1="https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=".$access_token."&id=1"; $res1 = file_get_contents($url1); //获取文件内容或获取网络请求的内容 $resul1 = json_decode($res1, true); //接受一个 JSON 格式的字符串并且把它转换为 PHP 变量 $bm=$resul1['department']; for($x=0;$x<count($bm);$x++) { $bmmc1=$bm[$x]['name']; if($bmmc1==$bmmc){ $url_add="https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=".$access_token; // $name = iconv('GB2312', 'UTF-8', $name); $arr=array('userid' => $userid,'name' => "$name" ,'mobile' => $mobile,'department' =>$bm[$x]['id']); $data = json_encode($arr); // $res2=http_request($url_add, $data); echo $data; } } } $d4=add_user($access_token,'0000_000','彭剑锋','18011868766','未定义'); 有声明是UTF格式了,文件也是UTF8编码
2020-05-23