1234567891011121314151617181920212223242526 |
- <?php
- class Model_ljg extends Lin_Model {
- function __construct(){
- parent::__construct();
- }
- public function get_enteradd($data)
- {
- $ch = curl_init();
- $url = 'http://ljg.xchuicheng.com/iotApi/syncStockIn';
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch,CURLOPT_HEADER,0);
- curl_setopt($ch,CURLOPT_POST, 1);
- curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,600);
- //设置post数据
- $post = array();
- $post['sku'] = $data['sku'];
- $post['title'] = $data['title'];
- $post['number'] = $data['number'];
- curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
- $res = curl_exec($ch);
- curl_close($ch);
- $res = json_decode($res,true);
- return $res;
- }
- } //end class
|