<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2017/11/20
 * Time: 下午4:12
 */

namespace App\Http\Controllers\Channel\Finance;


use App\Http\Controllers\Channel\Finance\Transformers\WithdrawCashFinancialTransformer;
use App\Http\Controllers\Channel\Finance\Transformers\WithdrawCashTransformer;
use App\Modules\Finance\Services\CashAccountService;
use App\Modules\Finance\Services\FinanceService;
use App\Modules\Finance\Services\FinancialConfigService;
use App\Modules\Finance\Services\FinancialStatService;
use App\Modules\Finance\Services\WithdrawCashService;
use Illuminate\Http\Request;

class WithdrawCashController extends BaseController
{

    /**
     * @apiDefine Finance 结算提现模块
     */

    /**
     * @apiVersion 1.0.0
     * @apiDescription 申请提现
     * @api {POST} addWithdrawCash 添加提现信息
     * @apiGroup Finance
     * @apiName addWithdrawCash
     * @apiParam   {Number}  amount 提现金额.
     * @apiParam   {String}  [remark] 备注说明.
     * @apiSuccess   {Number}  enable_amount 可提现总额.
     * @apiSuccess   {Number}  withdraw_pending_amount 提现中金额.
     * @apiSuccessExample {json} Success-Response:
     *
     *     {
     *         "code": 0,
     *         "msg": "",
     *         "data":{
     *                  "enable_amount": 70,
     *                  "withdraw_pending_amount": 1100
     *              }
     *     }
     */
	// 注意：还有自动提现功能，改逻辑一起改
    function add_withdrawCash(Request $request) {
        $distribution_channel_id = $this->getChannelId();
        $distribution_channel_name = $this->getChannelName();
        $distribution_channel_name = '';

        $amount = $request->has('amount') ? $request->input('amount') : '';
        if(!is_numeric($amount)) {
            return response()->error("PARAM_ERROR");
        }
        if($amount < 100) {
            //TODO 渠道14，取消100 金额的判断 大于1一块钱就可以
            if($distribution_channel_id == 14 || $distribution_channel_id = "14" || $distribution_channel_id = '14') {
                if($amount < 1) {
                    return response()->error("WITHDRAW_CASH_AMOUNT");
                }
            } else {
                return response()->error("WITHDRAW_CASH_AMOUNT");
            }
        }
        if($amount >= (20 * 10000)) {
            //TODO 取消单笔提现额度限制
            //return response()->error("WITHDRAW_CASH_AMOUNT_MORE");
        }

        $remark = $request->has('remark') ? $request->input('remark') : '';

        $financialStat = FinancialStatService::getFinancialStatSingle($distribution_channel_id);
        if(empty($financialStat) || $financialStat['enable_withdrawal_amount'] < $amount) {
            //可提现金额不够
            return response()->error("WITHDRAW_CASH_AMOUNT_INSUFFICIEN");
        }

        if(FinancialConfigService::isFrozenDistributionChannel($distribution_channel_id)) {
            //渠道被冻结
            return response()->error("WITHDRAW_CASH_AMOUNT_FROZEN");
        }

        //判断账户是否设置
        if(!CashAccountService::isCashAccountExits($distribution_channel_id)) {
            return response()->error("WITHDRAW_CASH_AMOUNT_ACCOUNT");
        }

        //判断今天是否已经提现
        if(WithdrawCashService::isWithdrawCashChannelToToday($distribution_channel_id)) {
            return response()->error("WITHDRAW_CASH_TODAY_USE");
        }

        WithdrawCashService::addWithdrawCash($distribution_channel_id, $amount, $remark);

        $financialStatUp = FinancialStatService::updateFinancialStatByWithdraw($distribution_channel_id, $amount);
        //修改可提现总额
        $enable_amount = $financialStatUp['enable_withdrawal_amount'];
        //修改提现中金额
        $withdraw_pending_amount = $financialStatUp['withdraw_pending_amount'];

        return response()->success(compact('enable_amount', 'withdraw_pending_amount'));
    }


    /**
     * @apiVersion 1.0.0
     * @apiDescription 获取提现列表
     * @api {GET} withdrawCashs 获取提现列表信息
     * @apiGroup Finance
     * @apiName withdrawCashs
     * @apiParam   {Number}  [status] 状态 查看接口 api/getWithdrawCashStatus (可不传，获取所有状态)
     * @apiParam   {String}  [start_time] 开始时间(可不传)
     * @apiParam   {String}  [end_time] 结束时间(可不传)
     * @apiSuccess   {Number}  amount 提现金额.
     * @apiSuccess   {Number}  pay_amount 打款金额.
     * @apiSuccess   {Number}  tallage 扣税金额.
     * @apiSuccess   {String}  status 状态.
     * @apiSuccess   {String}  remark 备注.
     * @apiSuccess   {Number}  check_user_id 审核人ID.
     * @apiSuccess   {String}  check_user_name 审核人姓名.
     * @apiSuccess   {String}  created_time 提现时间.
     * @apiSuccess   {String}  updated_time 最后更新时间.
     * @apiSuccessExample {json} Success-Response:
     *
     *     {
     *         "code": 0,
     *         "msg": "",
     *         "data": {
     *                   "list": [
     *                           {
     *                                       "amount": "330.00",
     *                                       "pay_amount": "319.00",
     *                                       "tallage": "11",
     *                                       "status": "待审核",
     *                                       "remark": null,
     *                                       "check_user_id": null,
     *                                       "check_user_name": null,
     *                                       "created_time": "2017-12-01 16:58:55",
     *                                       "updated_time": "2017-12-01 16:58:59"
     *                               }
     *                       ],
     *                   "meta": {
     *                       "total": 2,
     *                       "per_page": 15,
     *                       "current_page": 1,
     *                       "last_page": 1,
     *                       "next_page_url": "",
     *                       "prev_page_url": ""
     *                   }
     *              }
     *     }
     */
    function get_list(Request $request) {
        $distribution_channel_id = $this->getChannelId();
        $distribution_channel_name = $this->getChannelName();
        $distribution_channel_name = '';


        $start_time = $request->has('start_time') && !empty($request->input('start_time')) ? date('Ymd',strtotime($request->input('start_time'))) : '';
        $end_time = $request->has('end_time') && !empty($request->input('end_time')) ? date('Ymd',strtotime($request->input('end_time'))) : '';
        $end_time = self::getMaxDay($end_time);

        $statusIn = $request->has('status') ? $request->input('status') : '';
        $result = WithdrawCashService::getList($distribution_channel_id, $distribution_channel_name, $start_time, $end_time, $statusIn);
        return response()->pagination(new WithdrawCashTransformer(),  $result);
    }

    /**
     * @apiVersion 1.0.0
     * @apiDescription 财务对账
     * @api {get} WithdrawCash/financialCounting 财务对账
     * @apiGroup Finance
     * @apiName WithdrawCash/financialCounting
     * @apiParam   {String}  [account_name] 账户名称
     * @apiParam   {String}  [search_name] 搜索名称
     * @apiParam   {String}  [start_time] 开始时间(可不传)
     * @apiParam   {String}  [end_time] 结束时间(可不传)
     * @apiParam   {Number}  [is_frozen] 0:正常状态； -1:冻结状态.
     * @apiParam   {Number}  [status] 状态 查看接口 api/getWithdrawCashStatus (可不传，获取所有状态)
     * @apiSuccess   {Number}  id 提现ID.
     * @apiSuccess   {Number}  amount 提现金额.
     * @apiSuccess   {Number}  pay_amount 打款金额.
     * @apiSuccess   {String}  status 打款状态
     * @apiSuccess   {String}  remark 备注
     * @apiSuccess   {String}  check_user_name 审核人名称
     * @apiSuccess   {Number}  check_user_id 审核人ID
     * @apiSuccess   {String}  account_name 银行卡户主名称
     * @apiSuccess   {String}  identity_card 银行卡户主身份证
     * @apiSuccess   {String}  card_number 银行卡账号
     * @apiSuccess   {String}  account_bank 银行支行
     * @apiSuccess   {String}  bank 银行名称
     * @apiSuccess   {String}  province 银行地址
     * @apiSuccess   {String}  created_time 提现时间.
     * @apiSuccess   {String}  updated_time 审核时间
     * @apiSuccess   {Number}  tallage 税
     * @apiSuccess   {Number}  is_frozen 0:正常状态； -1:冻结状态.
     * @apiSuccess   {String}  fc_remark 冻结备注.
     * @apiSuccessExample {json} Success-Response:
     *
     *     {
     *         "code": 0,
     *         "msg": "",
     *         "data": {
     *                   "list": [
     *                           {
     *                              "id": 14,
     *                              "amount": "330.00",
     *                              "pay_amount 打款金额.": "220.00",
     *                              "status": "已打款",
     *                              "remark": "的发生的饭",
     *                              "check_user_name": "波哥的锅",
     *                              "check_user_id": 2,
     *                              "account_name": "宋晓",
     *                              "identity_card": "33038119930901821X",
     *                              "card_number": "6222520177654916",
     *                              "account_bank": "钱江支行",
     *                              "bank": "杭州银行",
     *                              "province": "北京市",
     *                              "created_time": "2017-11-30 16:24:25",
     *                              "updated_time": "2017-11-30 16:24:27",
     *                              "tallage": "110",
     *                              "is_frozen": 0,
     *                              "fc_remark": ""
     *                            }
     *                       ],
     *                   "meta": {
     *                       "total": 2,
     *                       "per_page": 15,
     *                       "current_page": 1,
     *                       "last_page": 1,
     *                       "next_page_url": "",
     *                       "prev_page_url": ""
     *                   }
     *              }
     *     }
     */
    function financial_counting(Request $request) {
        $distribution_channel_id = $this->getChannelId();
        $distribution_channel_name = $this->getChannelName();
        $distribution_channel_name = '';


        $start_time = $request->has('start_time') && !empty($request->input('start_time')) ? date('Ymd',strtotime($request->input('start_time'))) : '';
        $end_time = $request->has('end_time') && !empty($request->input('end_time')) ? date('Ymd',strtotime($request->input('end_time'))) : '';
        $end_time = self::getMaxDay($end_time);

        $isFrozen = $request->has('is_frozen') ? $request->input('is_frozen') : '';
        $account_name = $request->has('account_name') ? $request->input('account_name') : '';
        $search_name = $request->has('search_name') ? $request->input('search_name') : '';
        $status = $request->has('status') ? $request->input('status') : '';

        $params = [
            'channel_id'=>$distribution_channel_id,
            'channel_name'=>$distribution_channel_name,
            'start_date'=>$start_time,
            'end_date'=>$end_time,
            'is_frozen'=>$isFrozen,
            'account_name'=>$account_name,
            'search_name'=>$search_name,
        ];
        $result = WithdrawCashService::getFinancialCounting($params, $status);

        return response()->pagination(new WithdrawCashFinancialTransformer(),  $result);
    }

    /**
     * @apiignore
     * @apiVersion 1.0.0
     * @apiDescription 财务审核
     * @api {get} WithdrawCash/financialAudit 财务审核
     * @apiGroup Finance
     * @apiName WithdrawCash/financialAudit
     * @apiParam   {String}  [account_name] 账户名称
     * @apiParam   {String}  [search_name] 搜索名称
     * @apiParam   {String}  [start_time] 开始时间(可不传)
     * @apiParam   {String}  [end_time] 结束时间(可不传)
     * @apiParam   {Number}  [is_frozen] 0:正常状态； -1:冻结状态.
     * @apiParam   {Number}  [status] 状态 查看接口 api/getWithdrawCashStatus (可不传，获取所有状态)
     * @apiSuccess   {Number}  id 提现ID.
     * @apiSuccess   {Number}  amount 提现金额.
     * @apiSuccess   {Number}  pay_amount 打款金额.
     * @apiSuccess   {String}  status 打款状态
     * @apiSuccess   {String}  remark 备注
     * @apiSuccess   {String}  check_user_name 审核人名称
     * @apiSuccess   {Number}  check_user_id 审核人ID
     * @apiSuccess   {String}  account_name 银行卡户主名称
     * @apiSuccess   {String}  identity_card 银行卡户主身份证
     * @apiSuccess   {String}  card_number 银行卡账号
     * @apiSuccess   {String}  account_bank 银行支行
     * @apiSuccess   {String}  bank 银行名称
     * @apiSuccess   {String}  province 银行地址
     * @apiSuccess   {String}  created_time 提现时间.
     * @apiSuccess   {String}  updated_time 审核时间
     * @apiSuccess   {Number}  tallage 税
     * @apiSuccess   {Number}  is_frozen 0:正常状态； -1:冻结状态.
     * @apiSuccess   {String}  fc_remark 冻结备注.
     * @apiSuccessExample {json} Success-Response:
     *
     *     {
     *         "code": 0,
     *         "msg": "",
     *         "data": {
     *                   "list": [
     *                           {
     *                              "id": 14,
     *                              "amount": "330.00",
     *                              "pay_amount": "220.00",
     *                              "status": "已打款",
     *                              "remark": "的发生的饭",
     *                              "check_user_name": "波哥的锅",
     *                              "check_user_id": 2,
     *                              "account_name": "宋晓",
     *                              "identity_card": "33038119930901821X",
     *                              "card_number": "6222520177654916",
     *                              "account_bank": "钱江支行",
     *                              "bank": "杭州银行",
     *                              "province": "北京市",
     *                              "created_time": "2017-11-30 16:24:25",
     *                              "updated_time": "2017-11-30 16:24:27",
     *                              "tallage": "110",
     *                              "is_frozen": 0,
     *                              "fc_remark": ""
     *                            }
     *                       ],
     *                   "meta": {
     *                       "total": 2,
     *                       "per_page": 15,
     *                       "current_page": 1,
     *                       "last_page": 1,
     *                       "next_page_url": "",
     *                       "prev_page_url": ""
     *                   }
     *              }
     *     }
     */
    function financial_audit(Request $request) {
        $distribution_channel_id = $this->getChannelId();
        $distribution_channel_name = $this->getChannelName();
        $distribution_channel_name = '';


        $start_time = $request->has('start_time') && !empty($request->input('start_time')) ? date('Ymd',strtotime($request->input('start_time'))) : '';
        $end_time = $request->has('end_time') && !empty($request->input('end_time')) ? date('Ymd',strtotime($request->input('end_time'))) : '';
        $end_time = self::getMaxDay($end_time);

        $isFrozen = $request->has('is_frozen') ? $request->input('is_frozen') : '';
        $account_name = $request->has('account_name') ? $request->input('account_name') : '';
        $search_name = $request->has('search_name') ? $request->input('search_name') : '';
        $status = $request->has('status') ? $request->input('status') : '';

        $params = [
            'channel_id'=>$distribution_channel_id,
            'channel_name'=>$distribution_channel_name,
            'start_date'=>$start_time,
            'end_date'=>$end_time,
            'is_frozen'=>$isFrozen,
            'account_name'=>$account_name,
            'search_name'=>$search_name,
        ];
        $result = WithdrawCashService::getFinancialAudit($params, $status);

        return response()->pagination(new WithdrawCashFinancialTransformer(),  $result);
    }

    /**
     * @apiignore
     * @apiVersion 1.0.0
     * @apiDescription 对账统计数据
     * @api {get} WithdrawCash/dataStatistics 对账统计数据
     * @apiGroup Finance
     * @apiName WithdrawCash/dataStatistics
     * @apiSuccess   {Number}  yesterday_amount_audit_success 昨日已审核金额
     * @apiSuccess   {Number}  all_amount_audit_success 所有已审核金额
     * @apiSuccess   {Number}  yesterday_amount_apply 昨日申请提现金额
     * @apiSuccess   {Number}  all_amount_apply 所有申请提现金额
     * @apiSuccess   {Number}  yesterday_amount_audit_fail 昨日审核不通过
     * @apiSuccess   {Number}  all_amount_audit_fail 所有审核不通过
     * @apiSuccess   {Number}  yesterday_amount_apply_success 昨日成功提现金额
     * @apiSuccess   {Number}  all_amount_apply_success 所有成功提现金额
     * @apiSuccess   {Number}  yesterday_apply_num 昨日累积提现笔数
     * @apiSuccess   {Number}  all_apply_num 所有累积提现笔数
     * @apiSuccess   {Number}  yesterday_tallage_count 昨日累积提现手续费
     * @apiSuccess   {Number}  all_stallage_count 所有累积提现手续费
     * @apiSuccess   {Number}  yesterday_payment_count 昨日累积打款金额
     * @apiSuccess   {Number}  all_payment_count 所有累积打款金额
     * @apiSuccess   {Number}  all_amount_apply_success_count 所有累积已提现金额
     * @apiSuccess   {Number}  all_amount_apply_count 所有累积可提现金额
     * @apiSuccessExample {json} Success-Response:
     *
     *     {
     *         "code": 0,
     *         "msg": "",
     *         "data": {
     *                   "yesterday_amount_audit_success": "660.00",
     *                   "all_amount_audit_success": "660.00",
     *                   "yesterday_amount_apply": "660.00",
     *                   "all_amount_apply": "660.00",
     *                   "yesterday_amount_audit_fail": "440.00",
     *                   "all_amount_audit_fail": "440.00",
     *                   "yesterday_amount_apply_success": "220.00",
     *                   "all_amount_apply_success": "220.00",
     *                   "yesterday_apply_num": 3,
     *                   "all_apply_num": 3,
     *                   "yesterday_tallage_count": 3,
     *                   "all_stallage_count": 3,
     *                   "yesterday_payment_count":200,
     *                   "all_payment_count":200,
     *                   "all_amount_apply_success_count": 3,
     *                   "all_amount_apply_count": 3,
     *              }
     *     }
     */
    function data_statistics(Request $request) {
        $dataWithdrawCash = FinanceService::getDataStatisticsWithdrawCash();

        //昨日已审核金额
        $yesterday_amount_audit_success = $dataWithdrawCash['yesterday_amount_audit_success'];
        //所有已审核金额
        $all_amount_audit_success = $dataWithdrawCash['all_amount_audit_success'];
        //昨日申请提现金额
        $yesterday_amount_apply = $dataWithdrawCash['yesterday_amount_apply'];
        //所有申请提现金额
        $all_amount_apply = $dataWithdrawCash['all_amount_apply'];
        //昨日审核不通过
        $yesterday_amount_audit_fail = $dataWithdrawCash['yesterday_amount_audit_fail'];
        //所有审核不通过
        $all_amount_audit_fail = $dataWithdrawCash['all_amount_audit_fail'];
        //昨日成功提现金额
        $yesterday_amount_apply_success = $dataWithdrawCash['yesterday_amount_apply_success'];
        //所有成功提现金额
        $all_amount_apply_success = $dataWithdrawCash['all_amount_apply_success'];
        //昨日累积提现笔数
        $yesterday_apply_num = $dataWithdrawCash['yesterday_apply_num'];
        //所有累积提现笔数
        $all_apply_num = $dataWithdrawCash['all_apply_num'];
        //昨日累积提现手续费
        $yesterday_tallage_count = $dataWithdrawCash['yesterday_tallage_count'];
        //所有累积提现手续费
        $all_stallage_count = $dataWithdrawCash['all_stallage_count'];


        $dataPayment = FinanceService::getDataStatisticsPayment();
        //昨日累积打款金额
        $yesterday_payment_count = $dataPayment['yesterday_payment_count'];
        //所有累积打款金额
        $all_payment_count = $dataPayment['all_payment_count'];


        $dataFinancialStat = FinanceService::getDataStatisticsFinancialStat();
        //所有累积已提现金额
        $all_amount_apply_success_count = $dataFinancialStat['all_amount_apply_success_count'];
        //所有累积可提现金额
        $all_amount_apply_count = $dataFinancialStat['all_amount_apply_count'];

        return response()->success(
            compact(
                'yesterday_amount_audit_success',
                'all_amount_audit_success',
                'yesterday_amount_apply',
                'all_amount_apply',
                'yesterday_amount_audit_fail',
                'all_amount_audit_fail',
                'yesterday_amount_apply_success',
                'all_amount_apply_success',
                'yesterday_apply_num',
                'all_apply_num',
                'yesterday_tallage_count',
                'all_stallage_count',
                'yesterday_payment_count',
                'all_payment_count',
                'all_amount_apply_success_count',
                'all_amount_apply_count'
            ));
    }

    /**
     * @apiignore
     * @apiVersion 1.0.0
     * @apiDescription 城市列表
     * @api {get} cities 城市列表
     * @apiGroup Finance
     * @apiName cities
     */
    function cities()
    {
        $cities_json = '{"北京市":["北京市"],"天津市":["天津市"],"河北省":["石家庄市","唐山市","秦皇岛市","邯郸市","邢台市","保定市","张家口市","承德市","沧州市","廊坊市","衡水市"],"山西省":["太原市","大同市","阳泉市","长治市","晋城市","朔州市","晋中市","运城市","忻州市","临汾市","吕梁市"],"内蒙古自治区":["呼和浩特市","包头市","乌海市","赤峰市","通辽市","鄂尔多斯市","呼伦贝尔市","巴彦淖尔市","乌兰察布市","兴安盟","锡林郭勒盟","阿拉善盟"],"辽宁省":["沈阳市","大连市","鞍山市","抚顺市","本溪市","丹东市","锦州市","营口市","阜新市","辽阳市","盘锦市","铁岭市","朝阳市","葫芦岛市"],"吉林省":["长春市","吉林市","四平市","辽源市","通化市","白山市","松原市","白城市","延边朝鲜族自治州"],"黑龙江省":["哈尔滨市","齐齐哈尔市","鸡西市","鹤岗市","双鸭山市","大庆市","伊春市","佳木斯市","七台河市","牡丹江市","黑河市","绥化市","大兴安岭地区"],"上海市":["上海市"],"江苏省":["南京市","无锡市","徐州市","常州市","苏州市","南通市","连云港市","淮安市","盐城市","扬州市","镇江市","泰州市","宿迁市"],"浙江省":["杭州市","宁波市","温州市","嘉兴市","湖州市","绍兴市","金华市","衢州市","舟山市","台州市","丽水市"],"安徽省":["合肥市","芜湖市","蚌埠市","淮南市","马鞍山市","淮北市","铜陵市","安庆市","黄山市","滁州市","阜阳市","宿州市","六安市","亳州市","池州市","宣城市"],"福建省":["福州市","厦门市","莆田市","三明市","泉州市","漳州市","南平市","龙岩市","宁德市"],"江西省":["南昌市","景德镇市","萍乡市","九江市","新余市","鹰潭市","赣州市","吉安市","宜春市","抚州市","上饶市"],"山东省":["济南市","青岛市","淄博市","枣庄市","东营市","烟台市","潍坊市","济宁市","泰安市","威海市","日照市","莱芜市","临沂市","德州市","聊城市","滨州市","菏泽市"],"河南省":["郑州市","开封市","洛阳市","平顶山市","安阳市","鹤壁市","新乡市","焦作市","濮阳市","许昌市","漯河市","三门峡市","南阳市","商丘市","信阳市","周口市","驻马店市"],"湖北省":["武汉市","黄石市","十堰市","宜昌市","襄阳市","鄂州市","荆门市","孝感市","荆州市","黄冈市","咸宁市","随州市","恩施土家族苗族自治州"],"湖南省":["长沙市","株洲市","湘潭市","衡阳市","邵阳市","岳阳市","常德市","张家界市","益阳市","郴州市","永州市","怀化市","娄底市","湘西土家族苗族自治州"],"广东省":["广州市","韶关市","深圳市","珠海市","汕头市","佛山市","江门市","湛江市","茂名市","肇庆市","惠州市","梅州市","汕尾市","河源市","阳江市","清远市","东莞市","中山市","潮州市","揭阳市","云浮市"],"广西壮族自治区":["南宁市","柳州市","桂林市","梧州市","北海市","防城港市","钦州市","贵港市","玉林市","百色市","贺州市","河池市","来宾市","崇左市"],"海南省":["海口市","三亚市","三沙市","儋州市"],"重庆市":["重庆市"],"四川省":["成都市","自贡市","攀枝花市","泸州市","德阳市","绵阳市","广元市","遂宁市","内江市","乐山市","南充市","眉山市","宜宾市","广安市","达州市","雅安市","巴中市","资阳市","阿坝藏族羌族自治州","甘孜藏族自治州","凉山彝族自治州"],"贵州省":["贵阳市","六盘水市","遵义市","安顺市","毕节市","铜仁市","黔西南布依族苗族自治州","黔东南苗族侗族自治州","黔南布依族苗族自治州"],"云南省":["昆明市","曲靖市","玉溪市","保山市","昭通市","丽江市","普洱市","临沧市","楚雄彝族自治州","红河哈尼族彝族自治州","文山壮族苗族自治州","西双版纳傣族自治州","大理白族自治州","德宏傣族景颇族自治州","怒江傈僳族自治州","迪庆藏族自治州"],"西藏自治区":["拉萨市","日喀则市","昌都市","林芝市","山南市","那曲地区","阿里地区"],"陕西省":["西安市","铜川市","宝鸡市","咸阳市","渭南市","延安市","汉中市","榆林市","安康市","商洛市"],"甘肃省":["兰州市","嘉峪关市","金昌市","白银市","天水市","武威市","张掖市","平凉市","酒泉市","庆阳市","定西市","陇南市","临夏回族自治州","甘南藏族自治州"],"青海省":["西宁市","海东市","海北藏族自治州","黄南藏族自治州","海南藏族自治州","果洛藏族自治州","玉树藏族自治州","海西蒙古族藏族自治州"],"宁夏回族自治区":["银川市","石嘴山市","吴忠市","固原市","中卫市"],"新疆维吾尔自治区":["乌鲁木齐市","克拉玛依市","吐鲁番市","哈密市","昌吉回族自治州","博尔塔拉蒙古自治州","巴音郭楞蒙古自治州","阿克苏地区","克孜勒苏柯尔克孜自治州","喀什地区","和田地区","伊犁哈萨克自治州","塔城地区","阿勒泰地区"],"台湾省":[],"香港特别行政区":[],"澳门特别行政区":[]}';
        $cities = json_decode($cities_json,1);
        return response()->success(compact('cities'));
    }

}