|
|
@@ -2028,9 +2028,12 @@ class Facility extends Api
|
|
|
if (empty($param['UniqId'])){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
- $res = \db('设备_产量计酬')
|
|
|
- ->where('UniqId',$param['UniqId'])
|
|
|
- ->delete();
|
|
|
+ $idList = explode(',',$param['UniqId']);
|
|
|
+ foreach ($idList as $key=>$value){
|
|
|
+ $res = \db('设备_产量计酬')
|
|
|
+ ->where('UniqId',$value)
|
|
|
+ ->delete();
|
|
|
+ }
|
|
|
if ($res !== false){
|
|
|
$this->success('删除成功');
|
|
|
}else{
|
|
|
@@ -2296,4 +2299,40 @@ class Facility extends Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //日产量上报班组信息批量修改
|
|
|
+ public function YieldTeamEdit()
|
|
|
+ {
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
+ $this->error('请求错误');
|
|
|
+ }
|
|
|
+ $param = $this->request->param();
|
|
|
+ if (empty($param['Uniqid']) || empty($param['teamID'])){
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $idList = explode(',',$param['Uniqid']);
|
|
|
+ $teamList = \db('设备_班组资料')->where('UniqId',$param['teamID'])->find();
|
|
|
+ $data = [];
|
|
|
+ for ($i=1;$i<11;$i++){
|
|
|
+ $data['sczl_bh'.$i] = $teamList['sczl_bh'.$i];
|
|
|
+ $data['sczl_rate'.$i] = $teamList['sczl_rate'.$i];
|
|
|
+ $data['sczl_bzdh'] = $teamList['sczl_bzdh'];
|
|
|
+ }
|
|
|
+ $j = 0;
|
|
|
+ foreach ($idList as $key => $value){
|
|
|
+ $sql = \db('设备_产量计酬')
|
|
|
+ ->where('UniqId',$value)
|
|
|
+ ->fetchSql(true)
|
|
|
+ ->update($data);
|
|
|
+ $res = \db()->query($sql);
|
|
|
+ if ($res === false){
|
|
|
+ $j++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($j === 0){
|
|
|
+ $this->success('修改成功');
|
|
|
+ }else{
|
|
|
+ $this->error('修改失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|