本文整理匯總了PHP中MY_Controller::_get_required_fields方法的典型用法代碼示例。如果您正苦於以下問題:PHP MY_Controller::_get_required_fields方法的具體用法?PHP MY_Controller::_get_required_fields怎麽用?PHP MY_Controller::_get_required_fields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MY_Controller
的用法示例。
在下文中一共展示了MY_Controller::_get_required_fields方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: lists
/**
* @author: liaoxianwen@ymt360.com
* @description 產品列表
*/
public function lists()
{
$post = $this->post;
$page = $this->get_page();
$show_page = empty($_POST['itemsPerPage']) ? FALSE : TRUE;
$ip_address = '';
// 當前id地址
if (empty($post['upid'])) {
$this->_return_json(array('status' => C('tips.code.op_failed'), 'msg' => '查詢條件不滿足'));
}
// 查詢所屬城市
if (!empty($post['locationId'])) {
$post['location_id'] = intval($post['locationId']);
}
// 優先取登錄用戶的所在城市
$cur = $this->userauth->current(TRUE);
$user_info = array();
if ($cur) {
$post['location_id'] = $cur['province_id'];
$local_info = $this->format_query('/location/info', array('where' => array('id' => $cur['province_id'])));
// 所在城市info信息
if (intval($local_info['status']) === 0) {
$user_info = array('location_id' => $cur['province_id'], 'line_id' => $cur['line_id'], 'name' => $local_info['info']['name']);
}
}
$customer_type = !empty($cur['customer_type']) ? $cur['customer_type'] : C('customer.type.normal.value');
$response = $this->format_query('/product/lists', array('upid' => $post['upid'], 'offset' => $page['offset'], 'location_id' => $post['location_id'], 'page_size' => $show_page ? $page['page_size'] : 0, 'user_info' => $user_info, 'customer_type' => $customer_type));
if (!empty($response['list'])) {
$response = $this->_format_product_lists($cur, $response);
//過濾輸出
$required_fields = parent::$_app_required_fields['product']['lists'];
parent::_get_required_fields($response, 'list', $required_fields['list']);
}
$this->_return_json($response);
}
示例2: lists
/**
* @author: liaoxianwen@ymt360.com
* @description 用戶
*/
public function lists()
{
$response = array('status' => C('status.auth.login_timeout'), 'msg' => '登錄超時,請重新登錄');
if ($this->_user_info) {
$post['where'] = '';
$post['where'] = array('customer_id' => $this->_user_info['id']);
$post['site_id'] = $this->_user_info['site_id'];
// 待收貨狀態特俗處理,包括三種狀態
if (isset($this->post['status'])) {
$post['status'] = $this->post['status'];
}
$lists = $this->format_query('/customer_coupon/lists', $post);
$res_lists = array();
$res_total = 0;
$res_all_total = 0;
if (!empty($lists) && isset($lists['status']) && $lists['status'] == 0) {
$res_lists = !empty($lists['list']) ? $lists['list'] : array();
$res_total = !empty($lists['total']) ? $lists['total'] : 0;
$res_all_total = !empty($lists['all_nums']) ? $lists['all_nums'] : 0;
}
$response = array('status' => C('tips.code.op_success'), 'msg' => 'success', 'lists' => $res_lists, 'total' => $res_total, 'all_total' => $res_all_total);
if (!empty($response['lists'])) {
$required_fields = parent::$_app_required_fields['coupon']['lists'];
parent::_get_required_fields($response, 'lists', $required_fields);
}
}
$this->_return_json($response);
}
示例3: get_unread_messages
/**
* @description app端獲取未讀消息
*/
public function get_unread_messages()
{
$app_uid = empty($_POST['app_uid']) ? 0 : intval($_POST['app_uid']);
if (!$app_uid) {
$this->_return_json(array('status' => -1, 'msg' => 'user_id為空'));
}
$app_type_id = C('jpush.app_type.dachu');
$msg_list = $this->MMessage_log->get_lists('*', array('app_type_id' => $app_type_id, 'app_uid' => $app_uid, 'status' => C('jpush.message_status.init')));
$msg_list = $this->_format_messages($msg_list);
if (!empty($msg_list)) {
$required_fields = parent::$_app_required_fields['message']['get_unread_messages'];
foreach ($msg_list as $k => $val) {
parent::_get_required_fields($msg_list, $k, $required_fields);
}
}
$this->_return_json(array('status' => 0, 'msg' => '獲取消息成功', 'lists' => $msg_list));
$this->_return_json($result);
}
示例4: cate_lists
/**
* @author: liaoxianwen@ymt360.com
* @description 專門獲取分類,目前是app分類頁數據接口
*/
public function cate_lists()
{
$return_data = $this->_get_lists();
extract($return_data);
if (!empty($data['list'])) {
//輸出參數過濾
$required_field = parent::$_app_required_fields['category']['cate_lists'];
if (!empty($data['list']['top'])) {
parent::_get_required_fields($data['list'], 'top', $required_field['list']['top']);
}
if (!empty($data['list']['second'])) {
foreach ($data['list']['second'] as $k => $v) {
parent::_get_required_fields($data['list']['second'], $k, $required_field['list']['second']);
}
}
}
$this->_return_json($data);
}
示例5: lists
/**
* @author: liaoxianwen@ymt360.com
* @description 廣告列表
*/
public function lists()
{
$site_id = C('app_sites.chu.id');
$status = C('status.common.success');
// 查詢所屬城市
if (!empty($this->post['pos_id'])) {
$pos_id = intval($this->post['pos_id']);
} else {
$this->_return_json(array('status' => C('tips.code.op_failed'), 'msg' => '廣告位id沒有標注'));
}
if (!isset($this->post['locationId'])) {
$location_id = C('open_cities.beijing.id');
} else {
$location_id = $this->post['locationId'];
}
// 檢測用戶是否已經登錄,
// 登錄用戶不允許切換城市
// 優先取登錄用戶的所在城市
$cur = $this->userauth->current(TRUE);
// 增加是否需要登錄的來判斷
$need_login = array(0);
if ($cur) {
$location_id = $cur['province_id'];
$need_login = array(0, 1);
}
$post = array('where' => array('status' => $status, 'location_id' => $location_id, 'site_id' => $site_id, 'in' => array('need_login' => $need_login), 'customer_type' => !empty($cur['customer_type']) ? $cur['customer_type'] : C('customer.type.normal.value')));
$data = $this->format_query('/ads/get_valid_ads_list', $post);
$status = empty($data['list']) ? FALSE : TRUE;
if ($status) {
$data['list'] = $this->_deal_by_pos_id($data, $pos_id, $cur);
}
if ($status && isset($data['list'])) {
$response = $data;
$required_fields = parent::$_app_required_fields['ads']['lists'];
parent::_get_required_fields($response, 'list', $required_fields);
} else {
$response = array('status' => C('tips.code.op_success'), 'list' => array(), 'msg' => '沒有廣告');
}
$this->_return_json($response);
}
示例6: baseinfo
/**
* 獲取個人信息
* @author yugang@dachuwang.com
* @since 2015-03-06
*/
public function baseinfo()
{
// 權限校驗
$this->check_validation('customer', 'view');
// 獲取當前登錄客戶
$cur = $this->userauth->current(TRUE);
$_POST['user_id'] = $cur['id'];
// 調用基礎服務接口,通過調用基礎服務無法獲取到對應的session信息
$return = $this->format_query('/customer/baseinfo', $_POST);
$valid_coupon_nums = $this->format_query('/customer_coupon/count', array('status' => C('coupon_status.valid.value'), 'customer_id' => $cur['id']));
$return['info']['valid_coupon_nums'] = $return['valid_coupon_nums'] = isset($valid_coupon_nums['total']) ? $valid_coupon_nums['total'] : 0;
if (!empty($return['info'])) {
//過濾輸出
$required_fields = parent::$_app_required_fields['customer']['baseinfo'];
parent::_get_required_fields($return, 'info', $required_fields['info']);
}
if (!empty($return['order'])) {
//過濾輸出
parent::_get_required_fields($return, 'order', $required_fields['order']);
}
$this->_return_json($return);
}
示例7: get_wx_order_info
public function get_wx_order_info()
{
if (!empty($_POST['order_number'])) {
$response_data = $this->format_query('/order/get_order', array('order_number' => $_POST['order_number']));
if (is_array($response_data['data'])) {
$response_data['data']['total_price'] /= 100;
$response_data['data']['final_price'] /= 100;
$response_data['data']['minus_amount'] /= 100;
$response_data['data']['service_fee'] /= 100;
$response_data['data']['deliver_fee'] /= 100;
}
} else {
$response_data = array('status' => C('tips.code.op_failed'), 'msg' => '參數缺失');
}
if (!empty($response_data['data'])) {
//過濾字段
$required_fields = parent::$_app_required_fields['order']['get_wx_order_info']['data'];
parent::_get_required_fields($response_data, 'data', $required_fields);
}
$this->_return_json($response_data);
}