member_info['member_id']); $invoice_list = $invoice_model->getInvoiceList($condition, 10, '*'); ds_json_encode(10000, '', array('invoice_list' => $invoice_list)); } /** * @api {POST} api/Memberinvoice/invoice_info 发票信息详情 * @apiVersion 1.0.0 * @apiGroup MemberInvoice * * @apiHeader {String} X-DS-KEY 用户授权token * * @apiParam {Int} invoice_id 发票ID * * @apiSuccess {String} code 返回码,10000为成功 * @apiSuccess {String} message 返回消息 * @apiSuccess {Object} result 返回数据 * @apiSuccess {String} result.invoice_code 纳税人识别号[普通发票] * @apiSuccess {String} result.invoice_company 单位名称 * @apiSuccess {String} result.invoice_company_code 纳税人识别号 * @apiSuccess {String} result.invoice_content 发票内容[普通发票] * @apiSuccess {String} result.invoice_goto_addr 送票地址 * @apiSuccess {Int} result.invoice_id 发票信息ID * @apiSuccess {String} result.invoice_rec_mobphone 收票人手机号 * @apiSuccess {String} result.invoice_rec_name 收票人姓名 * @apiSuccess {String} result.invoice_rec_province 收票人省份 * @apiSuccess {String} result.invoice_reg_addr 注册地址 * @apiSuccess {String} result.invoice_reg_baccount 银行帐户 * @apiSuccess {String} result.invoice_reg_bname 开户银行 * @apiSuccess {String} result.invoice_reg_phone 注册电话 * @apiSuccess {Int} result.invoice_state 发票类型 1:普通发票 2:增值税发票 * @apiSuccess {String} result.invoice_title 发票抬头[普通发票] * @apiSuccess {Int} result.member_id 用户ID */ public function invoice_info() { $invoice_id = intval(input('post.invoice_id')); if ($invoice_id <= 0) { ds_json_encode(10001, lang('param_error')); } $invoice_model = model('invoice'); $result = $invoice_model->getInvoiceInfo(array('invoice_id' => $invoice_id, 'member_id' => $this->member_info['member_id'])); ds_json_encode(10000, '', $result); } /** * @api {POST} api/Memberinvoice/invoice_del 发票信息删除 * @apiVersion 1.0.0 * @apiGroup MemberInvoice * * @apiHeader {String} X-DS-KEY 用户授权token * * @apiParam {Int} invoice_id 发票ID * * @apiSuccess {String} code 返回码,10000为成功 * @apiSuccess {String} message 返回消息 */ public function invoice_del() { $invoice_id = intval(input('post.invoice_id')); if ($invoice_id <= 0) { ds_json_encode(10001, lang('param_error')); } $invoice_model = model('invoice'); $result = $invoice_model->delInvoice(array('invoice_id' => $invoice_id, 'member_id' => $this->member_info['member_id'])); if ($result) { ds_json_encode(10000, '', 1); } else { ds_json_encode(10001, lang('ds_common_op_fail')); } } /** * @api {POST} api/Memberinvoice/invoice_add 发票信息添加 * @apiVersion 1.0.0 * @apiGroup MemberInvoice * * @apiHeader {String} X-DS-KEY 用户授权token * * @apiParam {String} invoice_state 发票类型 * @apiParam {String} invoice_title 发票抬头[普通发票] * @apiParam {String} invoice_code 纳税人识别号[普通发票] * @apiParam {String} invoice_content 发票内容[普通发票] * @apiParam {String} invoice_company 单位名称 * @apiParam {String} invoice_company_code 纳税人识别号 * @apiParam {String} invoice_reg_addr 注册地址 * @apiParam {String} invoice_reg_phone 注册电话 * @apiParam {String} invoice_reg_bname 开户银行 * @apiParam {String} invoice_reg_baccount 银行帐户 * * @apiSuccess {String} code 返回码,10000为成功 * @apiSuccess {String} message 返回消息 * @apiSuccess {Object} result 返回数据 * @apiSuccess {Int} result.invoice_id 发票ID */ public function invoice_add() { $invoice_model = model('invoice'); $data = array(); $data['invoice_state'] = input('post.invoice_state'); $data['invoice_title'] = input('post.invoice_title'); $data['invoice_content'] = input('post.invoice_content'); $data['invoice_code'] = input('post.invoice_code'); $data['invoice_company'] = input('post.invoice_company'); $data['invoice_company_code'] = input('post.invoice_company_code'); $data['invoice_reg_addr'] = input('post.invoice_reg_addr'); $data['invoice_reg_phone'] = input('post.invoice_reg_phone'); $data['invoice_reg_bname'] = input('post.invoice_reg_bname'); $data['invoice_reg_baccount'] = input('post.invoice_reg_baccount'); $data['member_id'] = $this->member_info['member_id']; $result = $invoice_model->addInvoice($data); if ($result) { ds_json_encode(10000, '', array('invoice_id' => $result)); } else { ds_json_encode(10001, lang('ds_common_op_fail')); } } /** * @api {POST} api/Memberinvoice/invoice_edit 发票信息编辑 * @apiVersion 1.0.0 * @apiGroup MemberInvoice * * @apiHeader {String} X-DS-KEY 用户授权token * * @apiParam {Int} invoice_id 发票ID * @apiParam {String} invoice_state 发票类型 * @apiParam {String} invoice_title 发票抬头[普通发票] * @apiParam {String} invoice_code 纳税人识别号[普通发票] * @apiParam {String} invoice_content 发票内容[普通发票] * @apiParam {String} invoice_company 单位名称 * @apiParam {String} invoice_company_code 纳税人识别号 * @apiParam {String} invoice_reg_addr 注册地址 * @apiParam {String} invoice_reg_phone 注册电话 * @apiParam {String} invoice_reg_bname 开户银行 * @apiParam {String} invoice_reg_baccount 银行帐户 * * @apiSuccess {String} code 返回码,10000为成功 * @apiSuccess {String} message 返回消息 */ public function invoice_edit() { $invoice_id = intval(input('post.invoice_id')); $invoice_model = model('invoice'); $data['invoice_state'] = input('post.invoice_state'); $data['invoice_title'] = input('post.invoice_title'); $data['invoice_content'] = input('post.invoice_content'); $data['invoice_code'] = input('post.invoice_code'); $data['invoice_company'] = input('post.invoice_company'); $data['invoice_company_code'] = input('post.invoice_company_code'); $data['invoice_reg_addr'] = input('post.invoice_reg_addr'); $data['invoice_reg_phone'] = input('post.invoice_reg_phone'); $data['invoice_reg_bname'] = input('post.invoice_reg_bname'); $data['invoice_reg_baccount'] = input('post.invoice_reg_baccount'); $result = $invoice_model->editInvoice($data, array('invoice_id' => $invoice_id, 'member_id' => $this->member_info['member_id'])); if ($result) { ds_json_encode(10000, ''); } else { ds_json_encode(10001, lang('ds_common_op_fail')); } } /** * 发票内容列表 */ public function invoice_content_list() { $invoice_content_list = array( lang('detailed'), lang('alcohol'), lang('food'), lang('drinks'), lang('toys'), lang('daily_necessities'), lang('decoration_materials'), lang('cosmetics'), lang('office_supplies'), lang('student_supplies'), lang('furnishings'), lang('ornaments'), lang('clothing'), lang('luggage'), lang('boutique'), lang('electrical_appliances'), lang('building_supplies'), lang('consumables'), lang('computer_parts') ); ds_json_encode(10000, '', array('invoice_content_list' => $invoice_content_list)); } }