| | |
| | | if(empty($this->apikey)) return fault('配置信息错误'); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 获取个人cms地址 |
| | | */ |
| | | public function getCmsUrl($tb_rid) |
| | | { |
| | | $send_data = [ |
| | | 'method' => 'cms.promotion.url', |
| | | 'app_id' => '20237820', |
| | | 'app_secret'=>'608e183d8bc44742ab544179bd54b2c3', |
| | | 'date' => date('Y-m-d H:i:s'), |
| | | 'tb_name' => $this->config['tb_name'], |
| | | 'tb_pid' => 'mm_4091757048_2861600076_114781900494', |
| | | 'tb_rid' => $tb_rid, |
| | | ]; |
| | | $send_data['sign'] = $this->sign_create($send_data,'608e183d8bc44742ab544179bd54b2c3'); |
| | | $http = new Http(); |
| | | $param = json_encode($send_data); |
| | | $result = $http->post(self::request_url['tk_rest_url'],$param,[ |
| | | CURLOPT_HTTPHEADER => [ |
| | | 'Content-Type: application/json', |
| | | 'Content-Length: ' . strlen($param) |
| | | ]]); |
| | | $result = json_decode($result,true); |
| | | if(empty($result) || $result['code'] != 200) fault('转链失败'); |
| | | return $result['data']['url']; |
| | | } |
| | | |
| | | |
| | | public function getShareLink($goods_id,$common_relation_id,$relation_id) |