Recently in the rewriting of a Taobao guest's website, considering the future expansion, so integrate it into CI, this will appear a problem, Taobao SDK how to integrate into the class library? After reading the Taobao API document, I found a non-SDK call method, I modified this based on the integration of the helper function of CI, now the source to share with you, hope to help the students in need.
The invocation method is simple, passing in an array parameter, where methods are the API interfaces you intend to invoke, and the remaining parameters are filled in according to the actual needs of the API interface. I'm here to give you a call example to see.
The code is as follows |
Copy Code |
$paramArr = Array ( ' method ' => ' Taobao.taobaoke.items.get ', //api name ' fields ' = > ' num_iid,title,nick,pic_url,price,click_url,seller_credit_score, Commission, Commission_rate,volume ', ' pid ' => YOUR pid, ' page_size ' =>your page_size, ' sort ' =>your sort, ' Keyword ' =>your keyword, ); $this->load->helper (' Taoapi '); $result [' item_list '] = Send ($PARAMARR); |