|
|
@@ -2330,6 +2330,41 @@ class Facility extends Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 废品率系数批量修改
|
|
|
+ * @return void
|
|
|
+ * @throws \think\Exception
|
|
|
+ * @throws \think\db\exception\BindParamException
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
+ */
|
|
|
+ public function RejectionEdit()
|
|
|
+ {
|
|
|
+ if (Request::instance()->isPost() === false){
|
|
|
+ $this->error('请求错误');
|
|
|
+ }
|
|
|
+ $params = Request::instance()->post();
|
|
|
+ if (empty($params['id'])){
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $idList = explode(',',$params['id']);
|
|
|
+ $i=0;
|
|
|
+ foreach ($idList as $key=>$value){
|
|
|
+ $sql = \db('设备_产量计酬')
|
|
|
+ ->where('UniqId',$value)
|
|
|
+ ->fetchSql(true)
|
|
|
+ ->update(['sczl_废品率系数'=>$params['rejection']]);
|
|
|
+ $res = \db()->query($sql);
|
|
|
+ if ($res === false){
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($i!==0){
|
|
|
+ $this->error('修改失败');
|
|
|
+ }else{
|
|
|
+ $this->success('修改成功');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 日产量上报班组信息批量修改
|
|
|
* @return void
|