/** * 更新商品启用&停用 */ public function update_brand() { $ids = $this->input->post('ids'); $d['status'] = $this->input->post('status'); if ($check_info = $this->brand_model->check_brand_update($ids, $d['status'])) { json_out_put(return_model('2022', $check_info, NULL)); } $this->db->where_in('id', $ids); $aff_row = $this->brand_model->update_brand_info($d); json_out_put(return_model(0, '添加成功', $aff_row)); }
/** * 多媒体上传 */ public function media_upload() { $thumb_config = $this->config->item('thumb_img'); $rt = return_model(); $img_info = $this->upload_model->deal_media_upload($thumb_config); if (count($img_info) > 0) { $rt['val'] = $img_info; } else { $rt = return_model(9001, '上传失败', NULL); } json_out_put($rt); }
/** * 更改状态 */ public function update_status() { $ids = $this->input->post('ids'); $status = $this->input->post('status'); $data['status'] = $status; $affect_row = $this->customer_model->update_status($data, $ids); if (is_numeric($affect_row)) { json_out_put(return_model(0, '更新成功', $affect_row)); } else { json_out_put(return_model('2001', '更新失败', NULL)); } }
/** * 编辑用户信息 */ public function edit_user() { $id = $this->input->post('id'); $d['nick_name'] = $this->input->post('nickname'); $d['email'] = $this->input->post('email'); $d['phone'] = $this->input->post('phone'); if ($this->input->post('roles')) { $d['role'] = implode(',', $this->input->post('roles')); } else { $d['role'] = ''; } $aff_row = $this->user_model->update_user_info($id, $d); if (is_numeric($aff_row)) { json_out_put(return_model(0, '修改成功!', $aff_row)); } else { json_out_put(return_model(1001, '修改失败!', NULL)); } }
/** * 编辑客户 */ public function update_order_info() { $order_id = $this->input->post('id'); $data = $this->order_model->get_order_params(); if ($data['type'] == order_manage_model::MULTIPLE_GOODS_TYPE) { if ($check_info = $this->order_model->check_order_num($data['groupid'], 1)) { json_out_put(return_model('2002', $check_info, NULL)); } } $affect_row = $this->order_model->update_order_info($data, array('id' => $order_id)); if (is_numeric($affect_row)) { json_out_put(return_model(0, '更新成功', $affect_row)); } else { json_out_put(return_model('2001', '更新失败', NULL)); } }
/** * 检查是否能退卡 * @param type $snum * @param type $enum */ private function _is_cancel($snum, $enum) { $sql = "SELECT `num_code`,IF(`status`=3,'已兑换','已退卡') AS `status_msg` \r\n FROM `gift_management`.`gift_card`\r\n WHERE `num_code`>={$snum} AND `num_code`<={$enum} AND `status` IN(3,5)"; $res = $this->db->query($sql)->result_array(); if ($res) { $str = ''; foreach ($res as $v) { $str .= $v['num_code'] . ':' . $v['status_msg'] . ','; } json_out_put(return_model('3001', '添加失败', $str)); } }
/** * 编辑商品 */ public function update_giftbook_info() { $giftbook_id = $this->input->post('id'); $data = $this->giftbook_model->get_giftbook_params(); if ($check_info = $this->goods_manage_model->check_goods_num($data['group_ids'])) { json_out_put(return_model('3002', $check_info, NULL)); } $affect_row = $this->giftbook_model->update_giftbook_info($data, array('id' => $giftbook_id)); if (is_numeric($affect_row)) { $this->giftbook_model->book_goods_num($giftbook_id, $data['group_ids']); json_out_put(return_model(0, '更新成功', $affect_row)); } else { json_out_put(return_model('3001', '更新失败', NULL)); } }
/** * 修改退卡信息 */ public function edit_cancel_giftcard() { $id = $this->input->post('id'); $d['sales_id'] = $this->input->post('sales'); $d['custom_id'] = $this->input->post('customer'); $d['end_user'] = $this->input->post('enduser'); $d['remark'] = $this->input->post('remark'); $d['modify_user'] = $this->uc_service->get_user_id(); $aff_row = $this->giftcard_model->update_cancel_giftcard($d, array('id' => $id)); if (is_numeric($aff_row)) { json_out_put(return_model(0, '修改成功!', $aff_row)); } else { json_out_put(return_model(3001, '修改失败!', NULL)); } }