예제 #1
0
 /**
  * @brief 开始采集商品信息
  */
 public function collect_goods()
 {
     $category = IFilter::act(IReq::get('category'), 'int');
     $url = IFilter::act(IReq::get('url'), 'url');
     $start = IFilter::act(IReq::get('start'), 'int');
     $end = IFilter::act(IReq::get('end'), 'int');
     $urlType = IFilter::act(IReq::get('urlType'), 'int');
     $seller_id = IFilter::act(IReq::get('seller_id'), 'int');
     if ($url) {
         //设置要插入的分类
         collect_facade::$category = $category;
         collect_facade::$seller_id = $seller_id;
         foreach ($url as $key => $val) {
             if ($val) {
                 //单品采集
                 if ($urlType == 1) {
                     $result = collect_facade::once($val);
                 } else {
                     $result = collect_facade::many($val, $start, $end);
                 }
                 if ($result['result'] == 'fail') {
                     die($result['msg']);
                 }
             }
         }
     }
     die('<script type="text/javascript">parent.artDialogCallback();</script>');
 }