bingyu-duanxinwangzhan/message-code/message-admin/application/index/controller/SysWorkOrder.php

68 lines
2.0 KiB
PHP

<?php
namespace app\index\controller;
use app\common\classLibrary\ClWechat;
use think\Request;
use think\Session;
class SysWorkOrder extends Common
{
/**
* lists
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\think\response\View
*/
public function lists()
{
return view();
}
/**
* actionLists
* @return \think\response\Json
*/
public function actionLists()
{
$field_arr = array(
array('field_name' => 'page','rule' => 'require|number'),
array('field_name' => 'pageSize','rule' => 'require|number')
);
$check_arr = $this->checkHave($field_arr);
if($check_arr[self::$error_code_name] == 0)
{
$url = config('api_domain').'/workOrder/lists';
$session = Session::get('admin');
$params = array();
$params['token'] = $session['password'];
$params['debug'] = 1;
$params['is_count'] = 1;
$params['page'] = $check_arr[self::$data_name]['page'];
$params['pageSize'] = $check_arr[self::$data_name]['pageSize'];
$result = ClWechat::http_post($url,$params);
$json_arr = json_decode($result,true);
$json_arr['code'] = $json_arr['error_code'];
$json_arr['data'] = $json_arr['lists'];
self::$result = $json_arr;
}
return json(self::$result);
}
/**
* update
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\think\response\View
*/
public function edit()
{
$id = Request::instance()->param('id');
$url = config('api_domain').'/workOrder/get';
$session = Session::get('admin');
$params = array();
$params['token'] = $session['password'];
$params['id'] = $id;
$params['debug'] = 1;
$result = ClWechat::http_post($url,$params);
$json_arr = json_decode($result,true);
$this->assign('info',$json_arr['info']);
return view();
}
}