edit-admin-price

This commit is contained in:
lccsw
2022-06-16 10:56:12 +08:00
parent 66a2f2ea20
commit f2d31ebc14
2 changed files with 23 additions and 10 deletions
+17 -7
View File
@@ -1103,6 +1103,9 @@ class Orders extends HD_Controller
$userinfo = $this->app_liche_users_model->get(['mobile'=>$row['mobile']]);
$this->orders_v2_entity->add_order($id,$userinfo['id']);
}
//重新生成合同
$this->order_contracts_model->delete(['o_id'=>$id]);
$this->orders_v2_entity->create_pdf($id);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功!');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败!');
@@ -1124,13 +1127,17 @@ class Orders extends HD_Controller
$services = json_decode($row['srv_ids'],true);
if($this->input->method()=='post'){
$info = $this->input->post();
foreach ($info as $key => $val) {
isset($money_json[$key]) && $money_json[$key] = $val;
if(!$val){
foreach ($services as $k => $v) {
if($key==$v['key']){
unset($services[$k]);
break;
if(is_array($info['money'])){
foreach ($info['money'] as $key => $val) {
if($val['checkbox']){
$money_json[$key] = $val['value'];
}else{
$money_json[$key] = 0;
foreach ($services as $k => $v) {
if($key==$v['key']){
unset($services[$k]);
break;
}
}
}
}
@@ -1147,6 +1154,9 @@ class Orders extends HD_Controller
$userinfo = $this->app_liche_users_model->get(['mobile'=>$row['mobile']]);
$this->orders_v2_entity->add_order($id,$userinfo['id']);
}
//重新生成合同
$this->order_contracts_model->delete(['o_id'=>$id]);
$this->orders_v2_entity->create_pdf($id);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功!');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败!');
+6 -3
View File
@@ -2,9 +2,12 @@
style="width: 90%;padding-top: 10px">
<? foreach ($srv_info as $value) {?>
<div class="am-form-group">
<label class="am-para-label"><?=$value['title']?></label>
<label class="am-para-label">
<input type="checkbox" name="money[<?=$value['key']?>][checkbox]" checked value="1">
<?=$value['title']?>
</label>
<div class="am-para-input">
<input type="text" value="<?=$value['money']?>" name="<?=$value['key']?>"/>
<input type="text" value="<?=$value['money']?>" name="money[<?=$value['key']?>][value]"/>
</div>
</div>
<?}?>
@@ -14,4 +17,4 @@
<button class="am-btn am-btn-secondary" type="submit">确定</button>
</div>
</div>
</form>
</form>