|
@@ -2133,4 +2133,73 @@ class Facility extends Api
|
|
|
$this->success('成功',$list);
|
|
$this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 工价系数修改
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\Exception
|
|
|
|
|
+ * @throws \think\db\exception\BindParamException
|
|
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function CoefficientEdit()
|
|
|
|
|
+ {
|
|
|
|
|
+ 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['工价系数']]);
|
|
|
|
|
+ $res = \db()->query($sql);
|
|
|
|
|
+ if ($res === false){
|
|
|
|
|
+ $i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($i!==0){
|
|
|
|
|
+ $this->error('修改失败');
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->success('修改成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 色度系数修改
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\Exception
|
|
|
|
|
+ * @throws \think\db\exception\BindParamException
|
|
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function ChromaDataEdit()
|
|
|
|
|
+ {
|
|
|
|
|
+ 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_ms'=>$params['ms']]);
|
|
|
|
|
+ $res = \db()->query($sql);
|
|
|
|
|
+ if ($res === false){
|
|
|
|
|
+ $i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($i!==0){
|
|
|
|
|
+ $this->error('修改失败');
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->success('修改成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|