| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use Monolog\Handler\IFTTTHandler;
- use Overtrue\Socialite\Providers\WeWorkProvider;
- use think\Db;
- use think\Request;
- use function fast\e;
- /**
- *
- * 产品部件库
- */
- class PartLib extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- public function index(){
- $this->success('产品_部件资料库');
- }
- /**
- * 新增产品部件库
- */
- 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('产品_部件库')
- ->field('
- id,
- part_code as 部件编码,
- part_name as 部件名称,
- sys_id,
- sys_rq as 创建时间,
- updatetime as 修改时间
- ')
- ->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);
- }
- /**
- * 修改产品部件库
- */
- public function ParEdit(){
- }
- /**
- * 删除产品部件库
- */
- public function ParDelete(){
- }
- }
|