|
|
@@ -26,14 +26,42 @@ class PartLib extends Api
|
|
|
* 新增产品部件库
|
|
|
*/
|
|
|
public function ParAdd(){
|
|
|
-
|
|
|
+ if (Request::instance()->isPost() == false){
|
|
|
+ $this->error('非法请求');
|
|
|
+ }
|
|
|
+ $params = Request::instance()->param();
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($params);
|
|
|
+ echo "<pre>";die;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取产品部件库
|
|
|
*/
|
|
|
public function ParList(){
|
|
|
+ if (Request::instance()->isGet() == false){
|
|
|
+ $this->error('非法请求');
|
|
|
+ }
|
|
|
+ $params = Request::instance()->param();
|
|
|
+ $where = [];
|
|
|
+
|
|
|
+ if (!empty($params['search'])){
|
|
|
+ $where['part_code|part_name|part_type'] = array('like','%'.$params['search'].'%');
|
|
|
+ }
|
|
|
|
|
|
+ $limit = $params['limit'];
|
|
|
+ if (empty($limit)){
|
|
|
+ $limit = 30;
|
|
|
+ }
|
|
|
+ $pages = $params['page'];
|
|
|
+ if (empty($pages)){
|
|
|
+ $pages = 1;
|
|
|
+ }
|
|
|
+ $list = Db::name('产品_部件库')->whereNull('mod_rq')->where($where)->page($pages)->limit($limit)->order('id desc')->select();
|
|
|
+ $total = Db::name('产品_部件库')->whereNull('mod_rq')->where($where)->count();
|
|
|
+ $data['list'] = $list;
|
|
|
+ $data['total'] = $total;
|
|
|
+ $this->success('获取工艺库列表',$data);
|
|
|
}
|
|
|
|
|
|
/**
|