|
@@ -579,29 +579,23 @@ class Facility extends Api
|
|
|
*/
|
|
*/
|
|
|
public function MachineTeamAdd()
|
|
public function MachineTeamAdd()
|
|
|
{
|
|
{
|
|
|
- if ($this->request->isGet() === false){
|
|
|
|
|
|
|
+ if (Request::instance()->isPost() === false ){
|
|
|
$this->error('请求错误');
|
|
$this->error('请求错误');
|
|
|
}
|
|
}
|
|
|
- $param = $this->request->param();
|
|
|
|
|
|
|
+ $param = Request::instance()->post();
|
|
|
if (empty($param)){
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $teamDetail = \db('设备_班组资料')
|
|
|
|
|
- ->where('UniqId',$param['UniqId'])
|
|
|
|
|
- ->find();
|
|
|
|
|
- if (empty($teamDetail)){
|
|
|
|
|
- $this->error('数据错误');
|
|
|
|
|
- }
|
|
|
|
|
$lastId = \db('设备_班组资料')
|
|
$lastId = \db('设备_班组资料')
|
|
|
->order('UniqId desc')
|
|
->order('UniqId desc')
|
|
|
->value('UniqId');
|
|
->value('UniqId');
|
|
|
if ($lastId<100000){
|
|
if ($lastId<100000){
|
|
|
$lastId = 1000000;
|
|
$lastId = 1000000;
|
|
|
}
|
|
}
|
|
|
- $teamDetail['sczl_jtbh'] = $param['machine'].'#';
|
|
|
|
|
- $teamDetail['UniqId'] = $lastId + 1;
|
|
|
|
|
- $teamDetail['sczl_bzdh'] = $param['team'];
|
|
|
|
|
- $res = \db('设备_班组资料')->insert($teamDetail);
|
|
|
|
|
|
|
+ $param['sys_rq'] = date('Y-m-d H:i:s',time());
|
|
|
|
|
+ $param['UniqId'] = $lastId + 1;
|
|
|
|
|
+ $param['mod_rq'] = date('Y-m-d H:i:s',time());
|
|
|
|
|
+ $res = \db('设备_班组资料')->insert($param);
|
|
|
if ($res !== false){
|
|
if ($res !== false){
|
|
|
$this->success('成功');
|
|
$this->success('成功');
|
|
|
}else{
|
|
}else{
|
|
@@ -1637,4 +1631,30 @@ class Facility extends Api
|
|
|
->select();
|
|
->select();
|
|
|
$this->success('成功',$data);
|
|
$this->success('成功',$data);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 员工信息获取
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
+ * @throws \think\exception\DbException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function EmployeeData()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = $this->request->param();
|
|
|
|
|
+ if (isset($param['code']) === false){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $res = \db('人事_基本资料')
|
|
|
|
|
+ ->where('员工编号','like',$param['code'].'%')
|
|
|
|
|
+ ->field('rtrim(员工编号) as 员工编号,rtrim(员工姓名) as 员工姓名')
|
|
|
|
|
+ ->select();
|
|
|
|
|
+ if (empty($res)){
|
|
|
|
|
+ $this->success('未找到该员工');
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->success('成功',$res);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|