12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace app\admin\controller;
- use app\admin\model\ChangeLog;
- use app\BaseController;
- use think\App;
- use think\facade\Db;
- //客户
- class Customar extends Base
- {
- public $post = "";
- public function __construct(App $app)
- {
- parent::__construct($app);
- $this->post = $this->request->post();
- }
- public function create()
- {
- $param = $this->request->filter('trim')->post();
- $param['uid']= $this->uid;
- $param['uname']= $this->uname;
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('cCreate',$param);
- return json_show($rs['code'],$rs['message'],$rs['data']);
- }
- public function list()
- {
- $param = $this->request->filter('trim')->post();
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('cList',$param);
- return json_show($rs['code'],$rs['message'],$rs['data']);
- }
- public function edit()
- {
- $param = $this->request->filter('trim')->post();
- $param['uid']= $this->uid;
- $param['uname']= $this->uname;
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('cEdit',$param);
- return json_show($rs['code'],$rs['message'],$rs['data']);
- }
- public function info()
- {
- $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !== "" ? trim($this->post['companyNo']) : "";
- if ($companyNo == "") return error_show(1002, "参数companyNo不能为空");
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('cInfo',['companyNo'=>$companyNo]);
- return json_show($rs['code'],$rs['message'],$rs['data']);
- }
- public function del(){
- $param = $this->request->only(['id' => 0], 'post', 'trim');
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('delete', [
- 'ids' => [$param['id']],
- 'type' => 2,
- 'updater' => $this->uname,
- 'updaterid' => $this->uid,
- ]);
- return json_show($rs['code'], $rs['message'], $rs['data']);
- }
- public function status(){
- $param = $this->request->only(['id', 'status'], 'post', 'trim');
- $param = array_merge($param, [
- 'type' => 2,
- 'updater' => $this->uname,
- 'updaterid' => $this->uid,
- ]);
- $userCommon = \app\admin\common\User::getIns();
- $rs = $userCommon->handle('status', $param);
- return json_show($rs['code'], $rs['message'], $rs['data']);
- }
- }
|