diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 016ed03d..adbe94b4 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -47,8 +47,8 @@ class infofix extends CI_Controller // 链接 $sub_url = mb_stripos($info->ic_url, $key) !== false ? $info->ic_url : ''; if ($sub_url) { - $sub_url = str_replace($key,'@@@'.$key.'@@@',$sub_url); - $sub_url = explode('@@@',$sub_url); + $sub_url = str_replace($key, '@@@' . $key . '@@@', $sub_url); + $sub_url = explode('@@@', $sub_url); } $limitStr = 100; @@ -58,8 +58,8 @@ class infofix extends CI_Controller $sub_content = array(); while ($pos_content) { $_str = '[...' . mb_substr($info->ic_content, $pos_content - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - $_str = str_replace($key,'@@@'.$key.'@@@',$_str); - $_str = explode('@@@',$_str); + $_str = str_replace($key, '@@@' . $key . '@@@', $_str); + $_str = explode('@@@', $_str); array_push($sub_content, $_str); $pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key)); } @@ -72,8 +72,8 @@ class infofix extends CI_Controller $pos_content2 = mb_stripos($info->amp_json, $key); while ($pos_content2) { $_str = '[...' . mb_substr($info->amp_json, $pos_content2 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - $_str = str_replace($key,'@@@'.$key.'@@@',$_str); - $_str = explode('@@@',$_str); + $_str = str_replace($key, '@@@' . $key . '@@@', $_str); + $_str = explode('@@@', $_str); array_push($sub_content2, $_str); $pos_content2 = mb_stripos($info->amp_json, $key, $pos_content2 + mb_strlen($key)); } @@ -86,8 +86,8 @@ class infofix extends CI_Controller $pos_content3 = mb_stripos($info->amp_body, $key); while ($pos_content3) { $_str = '[...' . mb_substr($info->amp_body, $pos_content3 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - $_str = str_replace($key,'@@@'.$key.'@@@',$_str); - $_str = explode('@@@',$_str); + $_str = str_replace($key, '@@@' . $key . '@@@', $_str); + $_str = explode('@@@', $_str); array_push($sub_content3, $_str); $pos_content3 = mb_stripos($info->amp_body, $key, $pos_content3 + mb_strlen($key)); } @@ -183,7 +183,41 @@ class infofix extends CI_Controller } echo json_encode($keyArr); - + + } + + /** + * 无条件获取内容 + * @param mixed $ic_id + * @return void + */ + function get_by_icid($ic_id) + { + $ic = $this->infoContents_model->get_ic_contents2($ic_id); + $json = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); + if ($ic) { + echo json_encode( + array( + 'state' => 0, + 'ic_content' => $ic->ic_content, + 'json' => $json + ) + ); + } else { + echo json_encode( + array( + 'state' => -1, + 'msg' => 'not content by ' . $ic_id + ) + ); + } + } + + function update_by_icid() + { + $ic_id = $this->input->get_post('ic_id'); + $ic_content = $this->input->get_post('ic_content'); + $this->infoContents_model->force_update($ic_id, $ic_content); } } diff --git a/application/views/mobile_first/ah-lantern-form.php b/application/views/mobile_first/ah-lantern-form.php index 8cf72a1d..7bb894cf 100644 --- a/application/views/mobile_first/ah-lantern-form.php +++ b/application/views/mobile_first/ah-lantern-form.php @@ -39,7 +39,7 @@
US$179
-
93 left
+
65 left
@@ -49,7 +49,7 @@
US$139
-
Sold out
+
57 left
@@ -430,7 +430,7 @@ premium_khomloy_input.disabled = true; vip_khomloy_input.disabled = false; - standard_khomloy_input.disabled = true; + standard_khomloy_input.disabled = false; ticket_date_november15th.addEventListener('click', function () { premium_khomloy_left.innerText ='Sold out' @@ -444,7 +444,7 @@ vip_khomloy_input.checked = true; currentTicketPrice = parseInt(vip_khomloy_input.getAttribute('data-price')); adultNumberValue = parseInt(adultNumberNode.value); - calcTotalPrice(dataPrice, adultNumberValue); + calcTotalPrice(currentTicketPrice, adultNumberValue); }); ticket_date_november16th.addEventListener('click', function () { @@ -459,7 +459,7 @@ premium_khomloy_input.checked = true; currentTicketPrice = parseInt(premium_khomloy_input.getAttribute('data-price')); adultNumberValue = parseInt(adultNumberNode.value); - calcTotalPrice(dataPrice, adultNumberValue); + calcTotalPrice(currentTicketPrice, adultNumberValue); }); });