<?php
/**
*跑街令
*/
class pjlAction extends baseAction
{
	/**
	 * @method    获取询价单列表
	 * @http      get
	 * @param     integer       page    [当前页]
	 * @param     integer       perPage [每页条数]
	 * @param     string        where   [限制条件]
	 * @param     string        order   [排序条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [pur_id] => 239
		                    [pur_status] => 0
		                    [pur_pu_id] => 223412
		                    [pur_vin] => 
		                    [pur_brand_id] => 6
		                    [pur_mod3_id] => 6141
		                    [pur_model] => 奥迪(进口) A4旅行版 (B8,8KH) 40 TFSI quattro [2013-2016]
		                    [pur_remark] => 
		                    [pur_imgs] => 
		                    [pur_atime] => 1540964960
		                    [pur_close_time] => 0
		                    [pur_ok_time] => 0
		                    [pur_pct_ids] => 7,701,24019
		                )
			            ...
			        )
				  )
	 */
	public function getPurchaseList()
	{
		if (!empty($_GET))
		{
			foreach ($_GET as $key => $value) 
			{
				$$key = $value;
			}
		}
		$PjlPurchase = new PjlPurchase();
		$res = $PjlPurchase->getPurchaseList($page,$perPage,$where,$order);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    跑街令开通配件商
	 * @http  POST
	 * @param shop_b2c_shop_id  int [必填] b2c店铺id
	 * @param shop_pu_id  int [必填] 用户id
	 * @param shop_name  str [必填]  店铺名称
	 * @param shop_pct_ids  str [选填] 地区id 逗号分割
	 * @param shop_addr  str [选填] 地址
	 * @param realname  str [必填] 申请人
	 * @return      {status:true,data:true}  {status:true,data:店铺已经存在} {status:false,data:xxx}
	 * @author lu
	 * @copyright 2018-11-05
	 */
	function openPjlShop()
	{
		$PjlShop=new PjlShop();
		$data=$_POST;
		$dataArr=[];
		if(empty($data['shop_b2c_shop_id']))
		{
			LibFc::ReturnJson(false,'b2c店铺id不正确');
		}
		if(empty($data['shop_pu_id']))
		{
			LibFc::ReturnJson(false,'用户id不正确');
			exit();
		}
		//校验是否已开通
		$res=$PjlShop->get('pl_shop',['count(1) count'],sprintf(' and shop_id=%d',$data['shop_pu_id']),true);
		if($res['data']['count']>0)
		{
			LibFc::ReturnJson(false,'店铺已经存在');
			exit();
		}
		if(empty($data['shop_name']))
		{
			LibFc::ReturnJson(false,'店铺名称不正确');
			exit();
		}
		$dataArr['shop_name']=$data['shop_name'];
		if(!empty($data['shop_pct_ids']))
		{
			$dataArr['shop_pct_ids']=$data['shop_pct_ids'];
		}
		if(!empty($data['shop_addr']))
		{
			$dataArr['shop_addr']=$data['shop_addr'];
		}
		if(empty($data['realname']))
		{
			LibFc::ReturnJson(false,'申请人不能为空');
			exit();
		}
		$info=[
			'realname'=>$data['realname'],
		];
		$dataArr['shop_license']=json_encode($info,JSON_UNESCAPED_UNICODE);
		$dataArr['shop_pu_id']=$data['shop_pu_id'];
		$dataArr['shop_style']='经销商';
		$dataArr['shop_apply_time']=time();
		$dataArr['shop_enter_time']=time();
		$dataArr['shop_b2c_shop_id']=$data['shop_b2c_shop_id'];
		$res=$PjlShop->addShop($data['shop_pu_id'], $dataArr);
		LibFc::ReturnJson(true,$res);
	}

	/**
	 * @method    计算询价单数量
	 * @http      get
	 * @param     string       where [限制条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    ['status'=>true,'data'=>['count'=>123]]
	 */
	public function getPurchaseCount()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$res = $PjlBase->get('pl_purchase', ['count(*) count'], $where,true);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据地址id获取地区信息
	 * @http      get 
	 * @param     string    ids [地区id字符串 , 如: 7,701,24019]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array 
	 *            ( 
	 *            	 [status] => 1 
	 *            	 [data] => Array 
	 *            	 ( 
	 *            	 	[7] => 河南省 
	 *            	 	[701] => 郑州市 
	 *            	 	[24019] => 中原区 
	 *            	 ) 
	 *            	 [code] => 0 
	 *            )
	 */
	public function getAddrByIds()
	{
		$PjlUser = new PjlUser();
		$res = $PjlUser->getAddrByIds($_GET['ids']);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据询价单id 获取 配件信息
	 * @http      get
	 * @param     array   ids 	[询价单id数组]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [pup_id] => 363
		                    [pup_pur_id] => 215
		                    [pup_part_id] => 2951
		                    [pup_name] => 发动机放油塞
		                    [pup_number] => 64646
		                    [pup_number_format] => 64646
		                    [pup_count] => 1
		                )
		                ....
		            )
		          )
	 */
	public function getPurchaseProductByIds()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$purIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($purIdArr))
			{
				$PjlBase = new PjlBase();
				$res = $PjlBase->get('pl_purchase_product', ['*'], sprintf('and pup_pur_id in (%s)', implode(',', $purIdArr)));
				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    根据询价单id 获取 询价单信息
	 * @http      get
	 * @param     array     ids 	[询价单id数组]
	 * @param     bool  	oneRow  [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [pur_id] => 239
			            [pur_status] => 0
			            [pur_pu_id] => 223412
			            [pur_vin] => 
			            [pur_brand_id] => 6
			            [pur_mod3_id] => 6141
			            [pur_model] => 奥迪(进口) A4旅行版 (B8,8KH) 40 TFSI quattro [2013-2016]
			            [pur_remark] => 
			            [pur_imgs] => 
			            [pur_atime] => 1540964960
			            [pur_close_time] => 0
			            [pur_ok_time] => 0
			            [pur_pct_ids] => 7,701,24019
			        )
				    [code] => 0
				  )
	 */
	public function getPurchaseByIds()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$purIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($purIdArr))
			{
				$PjlBase = new PjlBase();
				$res = $PjlBase->get('pl_purchase', ['*'], sprintf('and pur_id in (%s)', implode(',', $purIdArr)));

				if ($_GET['oneRow'])
					$res['data'] = $res['data'][0];

				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    根据询价单id 获取 询价单信息
	 * @http      get
	 * @param     array     ids 	[询价单id数组]
	 * @param     bool  	oneRow  [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [pur_id] => 239
			            [pur_status] => 0
			            [pur_pu_id] => 223412
			            [pur_vin] => 
			            [pur_brand_id] => 6
			            [pur_mod3_id] => 6141
			            [pur_model] => 奥迪(进口) A4旅行版 (B8,8KH) 40 TFSI quattro [2013-2016]
			            [pur_remark] => 
			            [pur_imgs] => 
			            [pur_atime] => 1540964960
			            [pur_close_time] => 0
			            [pur_ok_time] => 0
			            [pur_pct_ids] => 7,701,24019
			        )
				    [code] => 0
				  )
	 */
	public function getPurchaseOfferByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$fields=['*'];
		if(!empty($_GET['fields'])){
			$fields=explode(',',$_GET['fields']);
			$fields=array_filter($fields,'LibFc::Escape');
		}
		$PjlBase = new PjlBase();
		$res = $PjlBase->get('pl_purchase_offer', $fields, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];

		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据分类id 取分类信息
	 * @http      get
	 * @param     array     ids 	[分类id数组]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [part_id] => 4036
		                    [part_parent] => 4035
		                    [part_name] => 刹车蹄片
		                    [part_keyword] => 刹车蹄片,刹车蹄,制动蹄,前刹车蹄,后刹车蹄,前刹车蹄片,后刹车蹄片,驻车制动蹄片,手刹蹄片,手刹片,鼓式刹车片,鼓刹片,手刹皮
		                    [part_seq] => 1
		                )
						....
			        )

				    [code] => 0
				  )
	 */
	public function getPartByIds()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$partIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($partIdArr))
			{
				$PjlBase = new PjlBase();
				$res = $PjlBase->get('pl_part', ['*'], sprintf('and part_id in (%s)', implode(',', $partIdArr)));
				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    根据店铺id 取店铺信息
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				 (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [shop_id] => 223009
		                    [shop_pu_id] => 223009
		                    [shop_status] => 2
		                    [shop_style] => 经销商
		                    [shop_logo] => 
		                    [shop_name] => 卢先生的店
		                    [shop_pct_ids] => 19,1901,14382,14387
		                    [shop_addr] => 测试地址
		                    [shop_tel] => 
		                    [shop_info] => 
		                    [shop_img] => 
		                    [shop_license] => {"realname":"测试负责人"}
		                    [shop_checkby] => 
		                    [shop_apply_time] => 1541394399
		                    [shop_enter_time] => 1541394399
		                    [shop_quoted_count] => 0
		                    [shop_complete_count] => 0
		                    [shop_score] => 5.0
		                    [shop_scope] => 
		                    [shop_idcard] => 
		                    [shop_commission] => 0
		                    [shop_b2c_shop_id] => 223009
		                )
						...
			        )
				    [code] => 0
				  )
	 */
	public function getShopByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_shop', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];

		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取店铺数量
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array ( [status] => 1 [data] => Array ( [count] => 6 ) [code] => 0 ) 
	 */
	public function getShopCount()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$res = $PjlBase->get('pl_shop', ['count(*) count'], $where, true);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取订单总数量
	 * @http      get
	 * @param     [string]    where    [限制条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    ['status'=>true,'data'=>['count'=>123]]
	 */
	public function getOrderCount()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$res = $PjlBase->get('pl_order', ['count(*) count'], $where,true);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取订单列表
	 * @http      get
	 * @param     integer       page    [当前页]
	 * @param     integer       perPage [每页条数]
	 * @param     string        where   [限制条件]
	 * @param     string        order   [排序条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [ord_id] => 18
		                    [ord_pur_id] => 231
		                    [ord_po_id] => 90
		                    [ord_status] => cancel
		                    [ord_pu_uid] => 223412
		                    [ord_shop_id] => 223009
		                    [ord_money] => 3.00
		                    [ord_atime] => 1540534597
		                    [ord_remark] => 
		                    [proArr] => Array
		                        (
		                            [0] => Array
		                                (
		                                    [odp_id] => 27
		                                    [odp_ord_id] => 18
		                                    [odp_pup_name] => 1.2L发动机总成
		                                    [odp_price] => 1.00
		                                    [odp_count] => 1
		                                )

		                            [1] => Array
		                                (
		                                    [odp_id] => 28
		                                    [odp_ord_id] => 18
		                                    [odp_pup_name] => 发动机后吊钩
		                                    [odp_price] => 1.00
		                                    [odp_count] => 1
		                                )

		                            [2] => Array
		                                (
		                                    [odp_id] => 29
		                                    [odp_ord_id] => 18
		                                    [odp_pup_name] => 发动机前吊钩螺栓
		                                    [odp_price] => 1.00
		                                    [odp_count] => 1
		                                )

		                        )

		                    [u_id] => 223412
		                    [u_name] => yipartsmr
		                    [u_real_name] => MR
		                    [u_mobile] => 18825071640
		                    [shop_id] => 223009
		                    [shop_name] => 卢先生的店
		                    [shop_pu_id] => 223009
		                    [shop_tel] => 
		                    [shopUserName] => luwenzhao
		                    [shopUserRealName] => 大大卢
		                    [shop_main_tel] => 18825071654
		                )
		                ...
			        )
				  )
	 */
	public function getOrderList()
	{
		if (!empty($_GET))
		{
			foreach ($_GET as $key => $value) 
			{
				$$key = $value;
			}
		}
		$PjlOrder = new PjlOrder();
		$res = $PjlOrder->getOrderList($page,$perPage,$order,$where);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据订单条件 取订单信息
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [ord_id] => 18
			            [ord_status] => cancel
			            [ord_pu_uid] => 223412
			            [ord_shop_id] => 223009
			            [ord_pur_id] => 231
			            [ord_po_id] => 90
			            [ord_money] => 3.00
			            [ord_pro_money] => 3.00
			            [ord_freight_money] => 0.00
			            [ord_remark] => 
			            [ord_model_info] => {"mod3_id":"7373","brand_id":"7373","model":"上汽通用五菱 宝骏310 (CN180C) 1.5L 手动 2017 - 到今"}
			            [ord_pur_imgs] => 
			            [ord_addr] => {"name":"廖明荣","tel":"18825071640","addr":"北京北京市东城区测试的地址"}
			            [ord_atime] => 1540534597
			            [ord_pay_time] => 
			            [ord_orp_id] => 0
			            [ord_send_time] => 0
			            [ord_send_info] => {}
			            [ord_coplete_time] => 0
			            [ord_eva_time] => 0
			            [ord_close_time] => 1540539747
			        )
				    [code] => 0
				  )

	 */
	public function getOrderByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_order', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据订单条件 取订单配件信息
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [0] => Array
		                (
		                    [odp_id] => 27
		                    [odp_ord_id] => 18
		                    [odp_pop_id] => 135
		                    [odp_pup_id] => 401
		                    [odp_pup_name] => 1.2L发动机总成
		                    [odp_pup_number] => 23914970
		                    [odp_quality] => 原厂
		                    [odp_price] => 1.00
		                    [odp_money] => 1.00
		                    [odp_count] => 1
		                    [odp_atime] => 1540534597
		                )
		                ...
		            )
		          )   
	 */
	public function getOrderProductByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_order_product', $field, $where);
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据店铺id获取店铺总销量
	 * @http      get
	 * @param     array     ids 	[分类id数组]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
			      (
				    [status] => 1
				    [data] => Array
			        (
			            [1001] => 0
			            [149894] => 0
			            [223009] => 0
			            [223412] => 0
			            [223444] => 0
			            [172999] => 0
			        )
				    [code] => 0
				  )

	 */
	public function getShopBusiness()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$shopIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($shopIdArr))
			{
				$PjlShop = new PjlShop();
				$res = $PjlShop->getShopBusiness($shopIdArr, $_GET['time']);
				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    根据用户条件 取用户信息
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
				  (
				    [status] => 1
				    [data] => Array
			        (
			            [pu_uid] => 1001
			            [pu_pct_ids] => 19,1901,14423
			            [pu_money] => 1.00
			            [pu_purchase_count] => 4
			            [pu_complete_count] => 0
			            [pu_credit_score] => 78.0
			            [pu_atime] => 1533979013
			        )
				    [code] => 0
				   )
	 */
	public function getUserByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_user', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];

		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    编辑店铺信息
	 * @http   	  post
	 * @param     integer   shopId  [店铺id]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array 
	 *            ( 
	 *            	[shop_name] => hzqghost 
	 *            	[shop_logo] => 240/cd4c1475826304e1.jpg 
	 *            	[shop_status] => 1 
	 *            	[shop_style] => 经销商 
	 *            	[province] => 19 
	 *            	[city] => 1901 
	 *            	[region] => 14340 
	 *            	[shop_addr] => aaaa 
	 *            	[shop_tel] => 
	 *            	[shop_scope] => gh 
	 *            	[shop_info] => 
	 *            	[shop_img] => 240/ed0df5a33938271c.jpg 
	 *            	[shop_idcard] => 430321199007081111 
	 *            	[shop_id] => 1001 
	 *            	[shop_license] => {"license":"240\/5a4a8a7fd83b653d.jpg","realname":"hzq","idcardimg0":"240\/867be3c26f49d33f.jpg","idcardimg1":"240\/1a2c45a4102bb109.jpg","idcardimg2":"240\/763ec9698053addc.jpg"} 
	 *            	[shop_checkby] => Array 
	 *            	( 
	 *            		[remark] => 
	 *            	 	[name] => soul12 
	 *            	) 
	 *            	[shop_pct_ids] => 19,1901,14340 
	 *            )
	 */
	public function editShopBase()
	{
		// print_r($_POST);exit();
		if (LibFc::Int($_POST['shopId']) && !empty($_POST['data']) && is_array($_POST['data']))
		{
			$PjlShop = new PjlShop();
			$res = $PjlShop->setShopBase($_POST['shopId'], $_POST['data']);
			LibFc::ReturnJson(true, $res['data']);
		}
	}

	/**
	 * @method    获取物流信息
	 * @param     string   where    [限制条件]
	 * @param     string   type     [order | refund]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return
	 */
	public function getLogisDetail()
	{
		if (!empty($_GET['where']) && in_array($_GET['type'], ['order','refund']))
		{
			$PjlOrder = new PjlOrder();
			$res = $PjlOrder->getLogisDetail($_GET['where'], $_GET['type']);
			LibFc::ReturnJson(true, $res['data']);
		}
	}

	/**
	 * @method    订单售后历史
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    
	 */
	public function refundHistory()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_refund_pact left join pl_refund_log on rel_rep_id=rep_id', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];

		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    订单id获取支付信息
	 * @http      get
	 * @param     array      ids 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
					(
					    [status] => 1
					    [data] => Array
				        (
				            [orp_id] => 8
				            [orp_ord_id] => 6
				            [orp_status] => wait
				            [orp_pam_code] => weixin
				            [orp_pay_type] => gzh
				            [orp_money] => 0.04
				            [orp_style] => 0
				            [orp_por_id] => 0
				            [orp_por_guid] => 20181012173020625822098493061584
				            [orp_atime] => 1539336620
				            [orp_check] => 
				            [orp_pay_time] => 0
				            [orp_close_time] => 0
				        )
					    [code] => 0
					)
	 */
	public function getOrderPayInfoByIds()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$ordIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($ordIdArr))
			{
				$PjlBase = new PjlBase();
				$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
				$res = $PjlBase->get('pl_order_pay', $field, sprintf('and orp_ord_id in (%s) and orp_status = "paied"', implode(',', $ordIdArr)));

				if ($_GET['oneRow'])
					$res['data'] = $res['data'][0];

				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    获取物流状态
	 * @http      get
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    Array
					(
					    [0] => 无数据
					    [1] => 揽件中
					    [2] => 在途中
					    [3] => 派件中
					    [4] => 已签收
					    [5] => 已退签
					    [6] => 退回件
					    [7] => 疑难件
					) 
	 */
	public function getExpressStatus()
	{
		$PjlOrder = new PjlOrder();
		$res = $PjlOrder->expressStatus();
		LibFc::ReturnJson(true, $res);
	}

	/**
	 * @method    报价id获取报价信息
	 * @http      get
	 * @param     array      ids 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    
					Array
					(
					    [status] => 1
					    [data] => Array
					        (
					            [0] => Array
				                (
				                    [pop_id] => 141
				                    [pop_po_id] => 94
				                    [pop_pup_id] => 416
				                    [pop_price] => [{"puq_id":3,"quality":"品牌","price":"0.85"}]
				                    [pop_remark] => 系统自动报价
				                )
								....
					        )
					    [code] => 0
					)
	 */
	public function getOfferProductByIds()
	{
		if (!empty($_GET['ids']) && is_array($_GET['ids']))
		{
			$poIdArr = array_filter($_GET['ids'],'LibFc::Int');
			if (!empty($poIdArr))
			{
				$PjlBase = new PjlBase();
				$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
				$res = $PjlBase->get('pl_purchase_offer_price', $field, sprintf('and pop_po_id in (%s)', implode(',', $poIdArr)));

				if ($_GET['oneRow'])
					$res['data'] = $res['data'][0];

				LibFc::ReturnJson(true, $res['data']);
			}
		}
	}

	/**
	 * @method    获取提现记录
	 * @http      get
	 * @param     string     where 	[限制条件]
	 * @param     array      field  [需要查询的字段名称数组]
	 * @param     bool       oneRow [true 单行 | false 多行]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    
					Array
					(
					    [status] => 1
					    [data] => Array
				        (
				            [0] => Array
			                (
			                    [mow_id] => 3
			                    [mow_status] => 1
			                    [mow_u_id] => 223009
			                    [mow_total_money] => 1.00
			                    [mow_comm_money] => 0.02
			                    [mow_real_money] => 1.00
			                    [mow_pmc_id] => 31
			                    [mow_pmc_guid] => 20180926163038829280919665115661
			                    [mow_acc_id] => 5
			                    [mow_acc_data] => {"uac_id":"5","uac_type":"1","uac_alipay":"18825071654","uac_weixin":null,"uac_name":"卢文钊","uac_atime":"1536548571"}
			                    [mow_shop_commission] => 0.010
			                    [mow_by_uid] => 223009
			                    [mow_by_uname] => 
			                    [mow_atime] => 1537950642
			                    [mow_ok_time] => 1537950642
			                    [mow_close_time] => 
			                    [mow_remark] => 用户ID：223009提现1到 卢文钊 支付宝账户：18825071654
			                )
							....
				        )
					    [code] => 0
					)
	 */
	public function getMoneyWithdrawals()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('pl_money_withdrawals', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    发送订单短信
	 * @http      get
	 * @param     integer    ordId 	[订单id]
	 * @param     string     to     [发送对象]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    [status=>true,data=>'']
	 */
	public function sendOrdStatBySms()
	{
		$PjlOrder = new PjlOrder();
		$res = $PjlOrder->sendOrdStatBySms($_GET['ordId'],$_GET['to']);
		LibFc::ReturnJson(true, true);
	}

	/**
	 * @method    地区联动
	 * @http      get
	 * @param     string     where     [限制条件]
	 * @author    liao
	 * @copyright 2018-11-05
	 * @return    [status=>true,data=>'']
	 */
	public function getProvinceCity()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('yp_province_city', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取退货物流
	 * @http      get
	 * @param     integer     id     [订单id]
	 * @author    liao
	 * @copyright 2018-11-12
	 * @return    
	 */
	public function getRefundLogic()
	{
		$id = (int) $_GET['id'];
		if ($id > 0)
		{
			$PjlOrder=new PjlOrder();
			$res = $PjlOrder->get('pl_refund_pact',['rep_id','rep_refund_addr','rep_express_des','rep_refund_pro_time'],'and rep_id='.$id,true);
			$returnData = [];
			if(!empty($res['data']['rep_express_des']))
			{
				$logic = $PjlOrder->getLogisDetail('and rep_id='.$id,'refund');
				$res['data'] = array_merge($res['data'],json_decode($res['data']['rep_refund_addr'],true));
				//物流状态
				$logicType = $PjlOrder->expressStatus();
				$returnData['expInfo'] = $logic['data'];
				$returnData['logicType'] = $logicType;
				$returnData['baseInfo'] = $res['data'];
			}
			LibFc::ReturnJson(true, $returnData);
		}

	}

	public function getMoneyRate()
	{
		$data['withdrawRate']=0.01;
		LibFc::ReturnJson(true, $data);
	}
	/**
	 * @method    审核提现
	 * http post
	 * @param  mow_id int [必填] 记录id
	 * @param  mow_u_id int [必填] 用户id
	 * @param  mow_status int [必填] 状态 0|-1|1
	 * @param  mow_check_remark str [必填] 备注
	 * @param  mow_check_uid int [选填] 审核人id
	 * @param  mow_check_uname str [选填] 审核人
	 * @param  mow_ok_time int [选填] 到账时间
	 * @return    [json]        {status:true,data:true}
	 * @author lu
	 * @copyright 2018-11-09
	 */
	function checkWithdraw()
	{
		if(!LibFc::Int($_POST['mow_id']))
		{
			LibFc::ReturnJson(false, '记录不存在');
		}
		if(!LibFc::Int($_POST['mow_u_id']))
		{
			LibFc::ReturnJson(false, '用户不存在');
		}
		if(empty($_POST['mow_check_remark']))
		{
			LibFc::ReturnJson(false, '审核备注不能为空');
		}
		if(!in_array($_POST['mow_status'], [0,-1,1]))
		{
			LibFc::ReturnJson(false, '系统或错误，请稍后重试');
		}
		$PjlMoney=new PjlMoney();
		$res=$PjlMoney->get('pl_money_withdrawals',['count(1) count'],sprintf(' and mow_u_id=%d and mow_id=%d',$_POST['mow_u_id'],$_POST['mow_id']),true);
		if(empty($res['data']['count']))
		{
			LibFc::ReturnJson(false, '记录不存在');
		}
		$dataArr=[
			'mow_check_remark'=>$_POST['mow_check_remark'],
			'mow_check_uid'=>$_POST['mow_check_uid'],
			'mow_check_uname'=>$_POST['mow_check_uname'],
			'mow_ok_time'=>($_POST['mow_ok_time']?$_POST['mow_ok_time']:time())
		];

		$res=$PjlMoney->checkWithdraw($_POST['mow_id'], $_POST['mow_status'], $dataArr);
		LibFc::ReturnJson($res['status'], $res['data']);
	}
	/**
	 * @method    删除询价单
	 * @param   purArr  arr|int  [必填] 询价单id
	 * @return    [type]     [description]
	 * @author lu
	 * @copyright 2018-11-12
	 */
	function deletePur()
	{
		if(!empty($_POST['purArr']))
		{
			$purArr=is_array($_POST['purArr'])?$_POST['purArr']:[(int)$_POST['purArr']];
			$purArr=array_filter($purArr,'LibFc::Int');
			if(!empty($purArr))
			{
				$PjlPurchase=new PjlPurchase();
				$PjlPurchase->deletePur($purArr,$_POST['remark']);
			}
			LibFc::ReturnJson(true, true);
		}
		LibFc::ReturnJson(false, '询价单id不能为空');
	}
	/**
	 * @method    获取报价单列表
	 * @param   where  str   [选填] 例：and po_id=1
	 * @param   orderBy  str  [选填] 例： order by po_id desc
	 * @param   limit  str  [选填] 例： limit 1,2
	 * @return    [type]       [description]
	 * @author lu
	 * @copyright 2018-11-12
	 */
	function getOfferList()
	{
		$where=!empty($_POST['where'])?$_POST['where']:'';
		$orderBy=!empty($_POST['orderBy'])?$_POST['orderBy']:' order by po_id desc';
		$limit=!empty($_POST['limit'])?$_POST['limit']:'';
		$PjlPurchase=new PjlPurchase();
		$res=$PjlPurchase->get('pl_purchase_offer',['count(1) count'],$where,true);
		$data=[];
		$data['total']=$res['data']['count'];
		if($res['data']['count']>0)
		{
			// echo $limit;
			$res=$PjlPurchase->getOfferList($where,$orderBy,$limit);
			$data['lists']=$res['data'];
		}
		LibFc::ReturnJson(true, $data);
	}
	/**
	 * @method    根据报价单id获取询价单产品
	 * @param  offArr  arr [必填] 报价单id 
	 * @return    [type]               [description]
	 * @author lu
	 * @copyright 2018-11-12
	 */
	function getPurProductByOffId()
	{
		if(!empty($_POST['offArr']))
		{
			$field=[
				'po_id',
				'po_pur_id',
				'po_status',
				'po_opu_uid',
				'po_shop_id',
				'po_atime'
			];
			$where=sprintf(' and po_id in(%s)',implode(',',$_POST['offArr']));
			$PjlPurchase=new PjlPurchase();
			$res=$PjlPurchase->get('pl_purchase_offer',$field,$where);
			$offArr=$res['data'];
			$purArr=array_column($res['data'], 'po_pur_id');
			if(!empty($purArr))
			{
				$res=$PjlPurchase->getPurchasePro($purArr);
				foreach ($offArr as $k => $v) 
				{
					$v['purArr']=!empty($res['data'][$v['po_pur_id']])?$res['data'][$v['po_pur_id']]:[];
					$offArr[$k]=$v;
				}
				LibFc::ReturnJson(true, $offArr);
			}
		}
		LibFc::ReturnJson(true, []);
	}
	/**
	 * @method    删除报价单
	 * @param   offArr
	 * @return    [json]     {status:true,data:true}
	 * @author lu
	 * @copyright 2018-11-12
	 */
	function deleteOff()
	{
		if(!empty($_POST['offArr']))
		{
			$offArr=is_array($_POST['offArr'])?$_POST['offArr']:[(int)$_POST['offArr']];
			$offArr=array_filter($offArr,'LibFc::Int');
			if(!empty($offArr))
			{
				$PjlPurchase=new PjlPurchase();
				$PjlPurchase->deleteOff($offArr,$_POST['remark']);
			}
			LibFc::ReturnJson(true, true);
		}
		LibFc::ReturnJson(false, '询价单id不能为空');
	}

	/**
	 * @method    获取全部文章分类
	 * @http      get | post
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    Array
					(
					    [status] => 1
					    [data] => Array
					        (
					            [0] => Array
					                (
					                    [id] => 1
					                    [pId] => 0
					                    [name] => 关于我们
					                )
					            [1] => Array
					                (
					                    [id] => 2
					                    [pId] => 0
					                    [name] => 帮助中心
					                )
					            [2] => Array
					                (
					                    [id] => 3
					                    [pId] => 0
					                    [name] => 在线公告
					                )
					            [3] => Array
					                (
					                    [id] => 4
					                    [pId] => 0
					                    [name] => 用户账单
					                )
					        )
					    [code] => 0
					)
	 */
	public function getAllArticleSorts()
	{
		$PjlArticle = new PjlArticle();
		$res = $PjlArticle->articleAllSort();
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取全部文章状态
	 * @http      get | post
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    Array
					(
					    [status] => 1
					    [data] => Array
					        (
					            [1] => 启用
					            [-1] => 停用
					        )
					    [code] => 0
					)
	 */
	public function getArticleStatus()
	{
		$PjlArticle = new PjlArticle();
		$res = $PjlArticle->getArticleStatus();
		LibFc::ReturnJson(true, $res);
	}

	/**
	 * @method    根据限制条件获取文章
	 * @http      get 
	 * @param     string 	where 	[限制条件]
	 * @param     array 	field   [需要取得的数组,默认为全部]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    Array
					[status] => 1
				    [data] => Array
				        (
				            [art_id] => 9
				            [art_status] => 1
				            [art_title] => 版本信息
				            [art_short_des] => 
				            [art_txt] => xxx...
				            [art_sys] => 1
				            [art_atime] => 1535419392
				            [art_seq] => 1
				        )
				    [code] => 0
	 */
	public function getArticleByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('cm_article', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    根据限制条件获取文章分类
	 * @http      get 
	 * @param     string 	where 	[限制条件]
	 * @param     array 	field   [需要取得的数组,默认为全部]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    Array
					[status] => 1
				    [data] => Array
				        (
				            [0] => Array
			                (
			                    [cat_id] => 1
			                    [cat_name] => 关于我们
			                )
				        )
				    [code] => 0
	 */
	public function getArtCategoryByWhere()
	{
		$where = empty($_GET['where']) ? '' : $_GET['where'];
		$PjlBase = new PjlBase();
		$field = !empty($_GET['field']) && is_array($_GET['field']) ? $_GET['field'] : ['*'];
		$res = $PjlBase->get('cm_article_category left join cm_category on arc_cat_id=cat_id', $field, $where);

		if ($_GET['oneRow'])
			$res['data'] = $res['data'][0];
		LibFc::ReturnJson(true, $res['data']);
	}

	/**
	 * @method    获取分页文章
	 * @http      get 
	 * @param     int 	 	NowPage 	[当前页]
	 * @param     int 	 	PerPage   	[每页条数]
	 * @param     string 	where   	[限制条件]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    Array
					[status] => 1
				    [data] => Array
				        (
				            [0] => Array
			                (
			                    [art_id] => 9
			                    [art_status] => 1
			                    [art_title] => 版本信息
			                    [art_short_des] => 
			                    [art_txt] => xxx...
			                    [art_sys] => 1
			                    [art_atime] => 1535419392
			                    [art_seq] => 1
			                    [sortPath] => Array
			                        (
			                            [1] => 关于我们
			                        )
			                    [sortPathId] => 1
			                )
			                ...
				        )
				    [code] => 0
	 */
	public function getPageArt()
	{
		if(LibFc::Int($_GET['NowPage']) && LibFc::Int($_GET['PerPage']))
		{
			$PjlArticle = new PjlArticle();
			$res = $PjlArticle->getPageArt($_GET['NowPage'],$_GET['PerPage'],$_GET['where']);
			LibFc::ReturnJson(true, $res['data']);
		}
		LibFc::ReturnJson(false, '参数不正确');
	}

	/**
	 * @method    保存文章
	 * @http      post 
	 * @param     int 	 	userid 		[登陆的用户id]
	 * @param     int 	 	art_id   	[文章id,新增的文章则为空]
	 * @param     string 	artSort   	[文章分类, eg:12,13,14]
	 * @param     data      array       [$dataArr = [
											'art_status' 	文章状态 1启用 -1 停用
							                'art_title'		文章标题
							                'art_short_des' 文件介绍
							                'art_txt'		文章内容
							                'art_seq' 		文章顺序
							                'art_sys' 		1 系统文章 0 不是系统文章
										];]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>true]
	 */
	public function saveArticle()
	{
		$PjlArticle = new PjlArticle();
		$PjlArticle->saveArticle($_POST['userid'],$_POST['art_id'],$_POST['data'],$_POST['artSort']);
		LibFc::ReturnJson(true, true);
	}

	/**
	 * @method    文章 [状态、是否系统、顺序] 管理
	 * @http      post 
	 * @param     int 	 	artId   	[文章id]
	 * @param     string 	filter  	[对应的字段, eg:'art_status','art_sys','art_seq']
	 * @param     string 	status   	[修改的值]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>xxx文章id]			
	 */
	public function articleManage()
	{
		$filterArr = ['art_status','art_sys','art_seq'];

    	if (!empty($_POST['artId']) && !empty($_POST['status']) && in_array($_POST['filter'],$filterArr))
    	{
    		switch ($_POST['filter']) 
    		{
    			case 'art_status':
    				if ($_POST['status'] == 'on')
    					$status = 1;
    				else
    					$status = -1;
    				break;
    			case 'art_sys':
    				if ($_POST['status'] == 'on')
    					$status = 1;
    				else
    					$status = 0;
    				break;
    			case 'art_seq':
    				$status = $_POST['status'];
    		}
    		$artIdArr = array_unique(array_filter(explode(',', $_POST['artId'])));
    		if (!empty($artIdArr))
    		{
    			$PjlBase = new PjlBase();
    			$res = $PjlBase->set('cm_article',[$_POST['filter'] => $status],sprintf("and art_id in (%s)",implode(',', $artIdArr)));
    			LibFc::ReturnJson(true, $artIdArr);
    		}
    	}
    	LibFc::ReturnJson(false, '参数不正确');
	}

	/**
	 * @method    删除文章
	 * @http      post 
	 * @param     string 	 artId   	[文章id,eg:12,13,14]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>xxx文章id]			
	 */
	public function delArticle()
	{
		if (!empty($_POST['artId']))
    	{
    		$artIdArr = explode(',', trim($_POST['artId'],','));
    		$PjlArticle = new PjlArticle();
    		$res = $PjlArticle->delArticle($artIdArr);
    		LibFc::ReturnJson(true, $artIdArr);
    	}
    	LibFc::ReturnJson(false, '参数不正确');
	}

	/**
	 * @method    批量转移文章分类
	 * @http      post 
	 * @param     string 	 artId   	[文章id,eg:12,13,14]
	 * @param     string 	 sortId   	[分类id,eg:12,13,14]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>true]			
	 */
	public function changeArtSort()
	{
		$PjlArticle = new PjlArticle();
    	$artIdArr = explode(',',trim($_POST['artId'],','));
    	$sortIdArr = explode(',',trim($_POST['sortId'],','));
    	$res = $PjlArticle->changeArticleSort($artIdArr,$sortIdArr,$_POST['order']);
    	LibFc::ReturnJson($res['status'], $res['data']);
	}

	/**
	 * @method    修改文章分类
	 * @http      post 
	 * @param     int 	 artId   	[文章id]
	 * @param     int 	 sortId   	[分类id]
	 * @param 	  string type       [save 新增 | del 删除]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>true]			
	 */
	public function changeArtSortOne()
	{
		$PjlBase = new PjlBase();
    	if(LibFc::int($_POST['artId']) && LibFc::int($_POST['artSortId']) && $_POST['type'] == 'save')
    	{
    		$re = $PjlBase->Add('cm_article_category',['arc_art_id'=>$_POST['artId'],'arc_cat_id'=>$_POST['artSortId']]);
    		if($re['status'])
	    		LibFc::ReturnJson(true, true);
    	}
    	if(LibFc::int($_POST['artId']) && LibFc::int($_POST['artSortId']) && $_POST['type'] == 'del')
    	{
    		$re = $PjlBase->del('cm_article_category',sprintf(' and arc_art_id=%d and arc_cat_id=%d',$_POST['artId'],$_POST['artSortId']));
    		if($re['status'])
	    		LibFc::ReturnJson(true, true);
    	}
	    LibFc::ReturnJson(false, '参数不正确');
	}

	/**
	 * @method    修改文章分类
	 * @http      post 
	 * @param     int 	 artId   	[文章id]
	 * @param     int 	 sortId   	[分类id]
	 * @param 	  string type       [save 新增 | del 删除]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>true]			
	 */
	public function getArtColumnSort()
	{
		$PjlArticle = new PjlArticle();
		$data = $PjlArticle->columnSelect([],'');
		LibFc::ReturnJson(true, $data['data']);
	}

	/**
	 * @method    保存文章分类
	 * @http      post 
	 * @param     array 	 data   	[[1] => Array
	 *							        	(
	 *								            [cat_name] => 关于我们
	 *								            [cat_seq] => 1
	 *								            [cat_pcat_id] => 0
	 *								            [art_sys] => on
	 *								            [cat_site] => 0
	 *								        )
	 *								        ....
	 *								    ]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>true]			
	 */
	public function saveArtSort()
	{
		$PjlArticle = new PjlArticle();
		$res = $PjlArticle->saveArtSort($_POST['data']);
		LibFc::ReturnJson($res['status'], $res['data']);
	}

	/**
	 * @method    删除文章分类
	 * @http      post 
	 * @param     int 	 catId   	[分类id]
	 * @author    liao
	 * @copyright 2018-11-23
	 * @return    [status=>true,data=>文章id]			
	 */
	public function delArticleColumn()
	{
		$catId = (int) $_GET['catId'];
		if ($catId > 0)
		{
			$PjlArticle = new PjlArticle();
			$res = $PjlArticle->delArtCol($catId);
			LibFc::ReturnJson($res['status'], $res['data']);
		}
		LibFc::ReturnJson(false, '参数不正确');
	}
	
	

	/**
	 * @method    根据条件获取黑名单
	 * @http      post 
	 * @param     string 	where 	[限制条件]
	 * @param     array 	field   [需要取得的数组,默认为全部]
	 * @param     oneRow   bool     [是否单条]
	 * @author    lu
	 * @copyright 2018-12-14
	 */
	function getBlackList()
	{
		$where=!empty($_POST['where'])?$_POST['where']:'';
		$oneRow=!empty($_POST['oneRow'])?true:false;
		$fields=!empty($_POST['fields'])?$_POST['fields']:['*'];
		$PjltjBase=new PjltjBase();
		$res=$PjltjBase->get('tj_blacklist',$fields,$where,$oneRow);
		LibFc::ReturnJson($res['status'], $res['data']);
	}
	/**
	 * @method    添加黑名单
	 * @http post
	 * @param   bl_uid  int [必填] 用户id
	 * @param   bl_devcode  str [必填] 设备码
	 * @param   bl_etime  int [必填] 到期时间
	 * @param   bl_ip  int [选填] ip
	 * @return  ['status'=>true,'data'=>'记录id']
	 * @author lu
	 * @copyright 2018-12-14
	 */
	function addBlack()
	{
		$require=['bl_uid','bl_devcode','bl_etime'];
		$dataArr=$_POST;
		foreach ($require as $v) 
		{
			if(empty($dataArr[$v]))
			{
				LibFc::ReturnJson(false, $v.'参数不正确');
			}
			switch ($v) {
				case 'bl_etime':
					$dataArr[$v]=strtotime($dataArr[$v]);
					break;
			}
		}
		$dataArr['bl_atime']=time();
		$PjltjBase=new PjltjBase();
		$res=$PjltjBase->add('tj_blacklist',$dataArr);
		LibFc::ReturnJson($res['status'], $res['data']);
	}
	/**
	 * @method    修改黑名单
	 * @http post 
	 * @param  bl_id  int [必填] 记录id
	 * @param  bl_uid  int [选填] 
	 * ....
	 * ....
	 * @author lu
	 * @copyright 2018-12-14
	 */
	function setBlack()
	{
		$require=['bl_uid','bl_devcode','bl_etime','bl_id'];
		$dataArr=$_POST;
		$bid=0;
		foreach ($require as $v) 
		{
			if(empty($dataArr[$v]))
			{
				echo "string";
				LibFc::ReturnJson(false, $v.'参数不正确');
			}
			switch ($v) {
				case 'bl_etime':
					$dataArr[$v]=strtotime($dataArr[$v]);
					break;
				case 'bl_id':
					$bid=$dataArr[$v];
					unset($dataArr[$v]);
				break;
			}
		}
		$PjltjBase=new PjltjBase();
		$res=$PjltjBase->set('tj_blacklist',$dataArr,sprintf(' and bl_id=%d',$bid));
		LibFc::ReturnJson($res['status'], $res['data']);
	}
	/**
	 * @method    删除黑名单
	 * @http post
	 * @param int|arr ids  [必填] 记录id
	 * @return    [type]     [description]
	 * @author lu
	 * @copyright 2018-12-14
	 */
	function delBlack()
	{
		if(empty($_POST['ids']))
		{
			LibFc::ReturnJson(false, '记录ID不能为空');
		}
		$idArr=is_array($_POST['ids'])?$_POST['ids']:[(int)$_POST['ids']];
		$PjltjBase=new PjltjBase();
		$res=$PjltjBase->del('tj_blacklist',sprintf(' and bl_id in(%s)',implode(',',$idArr)));
		LibFc::ReturnJson($res['status'], $res['data']);
	}
	/**
	 * @method    根据车型id检查是否有保养件，epc,商城配件，常用件（新保养件）
	 * @param   m3Id   int  三级车型Id  
	 * @param  type  str  [可选]  默认为 all 取所有   all|byj|epc|b2c|cyj
	 * @return  {"status":true,"data":{"byj":1,"etk_id":"2","b2c":1,"cyj":1},"code":0}  返回{byj:0|1, etk_id:epc的id, b2c:0|1, cyj:0|1}
	 * @author lu
	 * @copyright 2019-01-08
	 */
	function checkShowItem()
	{
		$Params = mvc::$URL_PARAMS;
		$mod3_id = (int) $Params['m3Id'];
		$data=[];
		if($mod3_id > 0)
		{
			$typeArr= empty($Params['type'] || $Params['type'] == 'all')? ['byj','epc', 'b2c', 'cyj'] : $Params['type'];
			$YpcModel= new YpcModel();
			$B2cProduct= new B2cProduct();
			
			foreach($typeArr as $type)
			{
				switch($type)
				{
					//保养件
					case 'byj':
						$res=$YpcModel->getByjByM3Id($mod3_id);
						$data['byj']=count($res['data'])?1:0;
					break;
					case 'epc':
						$res=$YpcModel->checkModelPart($mod3_id);
						$data['etk_id']= empty($res['data']['has'])? 0: $res['data']['etk_id'];
					break;
					case 'b2c':
						//b2c
						$res=$B2cProduct->get('bc_product_model3_link',['count(1) count'],sprintf(' and pml3_mod3_id=%d', $mod3_id),true);
						$data['b2c']=$res['data']['count']?1:0;
					break;
					//常用件（新保养件）
					case 'cyj':
						$YpcBase = new YpcBase();
						$data[$type] = 0;
						
						//车型库号码
						$table = 'yc_number 
						JOIN yc_part ON num_part_id = part_id 
						JOIN yc_number_match ON num_fac_id = nm_num_fac_id AND num_format = nm_num_format AND num_part_id = nm_num_part_id';
						$res = $YpcBase->Get($table, ['part_partid_b2c'], sprintf(" and num_m3_id = %d and part_partid_b2c!='' limit 1", $mod3_id));
						if(!empty($res['data']))
						{
							$data[$type] = 1;
						}
						else
						{
							$res = $YpcBase->Get('yc_part', ['part_partid_b2c as spartid'], " order by part_seq");
							$spartIdArr = array_column($res['data'], 'spartid');

							//商城
							$B2cBase = new B2cBase();
							$table = sprintf("bc_product_model3_link 
							join bc_product on pml3_pro_id=pro_id and pro_show_pjl =1 and pro_status =1
							join sh_shop on pro_shop_id=shop_id and shop_status = 1", $shopid, time(), time());
							$where = sprintf(" and pml3_mod3_id = %d and concat(pro_part_id, '_', pro_pas_id) in ('%s') limit 1", $mod3_id, implode("','", $spartIdArr));
							$res = $B2cBase->get($table, ["concat(pro_part_id, '_', pro_pas_id) as spartid"], $where);
							if(!empty($res['data']))
							{
								$data[$type] = 1;
							}
						}
					break;
				}
			}
		}
		LibFc::ReturnJson(true, $data);
	}


	/**
	  * @method 获取PC版VIP价格
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  month  int [必填] 购买月数	  
	  * @param  level  int [必填] 变更后的级别  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function getVipPrice()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->getVipPrice($Params['uid'], $Params['month'], $Params['level']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 创建VIP开通、升级、续费订单
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  month  int [必填] 购买月数	  
	  * @param  level  int [必填] 变更后的级别  
	  * @param  referee string [选填] 推荐人手机号码
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function buildVipOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildVipOrder($Params['uid'], $Params['month'], $Params['level'], $Params['referee']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 人工开通PC版会员
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  month  int [必填] 购买月数	  
	  * @param  level  int [必填] 变更后的级别  
	  * @param  referee string [选填] 推荐人手机号码
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function manualOpenPcVip()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->manualOpenPcVip($_POST);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 获取VIP订单支付的支付信息
	  * @http  post
	  * @param  uvlId	   int [必填] 订单ID	  
	  * @param  payBy     string [必填]weixin|alipay
	  * @param  payType   string [必填]pc:扫码 app:APP wap:手机网 gzh:公众号
	  * @param  oth  array [可选] ['from'=>, 'wxopenid'=>]
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function payVipOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->payVipOrder($_POST['uvlId'], $_POST['payBy'], $_POST['payType'], $_POST['oth']);
		LibFc::EchoJson($res);
	
	}


	/**
	  * @method 检查VIP订单支付的支付信息
	  * @http  get
	  * @param  uvlId	   int [必填] 订单ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function checkVipOrderPay()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->checkVipOrderPay($Params['uvlId']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 资源包单价
	  * @http  get
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function pacPrice()
	{
		LibFc::ReturnJson(true, mvc::$cfg['PJL_PAC_PRICE']);
	}


	/**
	  * @method 创建资源包订单
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  vin  int [必填] 数量	  
	  * @param  number  int [必填] 数量  
	  * @param  etk  int [必填] 数量  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function buildPacOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildPacOrder($Params['uid'], $Params['vin'], $Params['number'], $Params['etk']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 获取资源包订单支付的支付信息
	  * @http  post
	  * @param  uplId	   int [必填] 订单ID	  
	  * @param  payBy     string [必填]weixin|alipay
	  * @param  payType   string [必填]pc:扫码 app:APP wap:手机网 gzh:公众号
	  * @param  oth  array [可选] ['from'=>, 'wxopenid'=>]
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function payPacOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->payPacOrder($_POST['uplId'], $_POST['payBy'], $_POST['payType'], $_POST['oth']);
		LibFc::EchoJson($res);
	
	}


	/**
	  * @method 检查资源包订单支付的支付信息
	  * @http  get
	  * @param  uplId	   int [必填] 订单ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function checkPacOrderPay()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->checkPacOrderPay($Params['uplId']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 检查此会员是否可以申请体验会员(尚未开通过会员的用户)
	  * @param  uid	   int [必填] 会员ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function checkCanFreeVip($uid)
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->checkCanFreeVip($Params['uid']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 申请体验会员
	  * @param  uid	   int [必填] 会员ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function applyFreeVip($uid)
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->applyFreeVip($Params['uid']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 申请体验商铺权益 15天
	  * @param  uid	   int [必填] 会员ID	  
	  * @author soul
	  * @copyright 2020/2/15
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function applyFreeShop($uid)
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->applyFreeShop($Params['uid']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 店铺审核
	  * @param  $shopId 店铺ID
	  * @author $status -1审核不通过  2审核通过
	  * @author $checkArr [name=>审核人, time=>审核时间 result=>0|1 remark=>审核意见]
	  * @copyright 2018/07/23
	  * @return ["status"=> bool(true), "data"=> "", "code"=>""]
	  */
	public function checkShopOpen()
	{
		$PjlShop = new PjlShop();
		$res = $PjlShop->checkShopOpen($_POST['shopId'], $_POST['status'], $_POST['check']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 创建余额充值订单
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  vin  int [必填] 数量	  
	  * @param  number  int [必填] 数量  
	  * @param  etk  int [必填] 数量  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function buildChongZhiOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildChongZhiOrder($Params);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 获取余额充值订单支付的支付信息
	  * @http  post
	  * @param  mocId	   int [必填] 订单ID	  
	  * @param  payBy     string [必填]weixin|alipay
	  * @param  payType   string [必填]pc:扫码 app:APP wap:手机网 gzh:公众号
	  * @param  oth  array [可选] ['from'=>, 'wxopenid'=>]
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function payChongZhiOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->payChongZhiOrder($_POST['mocId'], $_POST['payBy'], $_POST['payType'], $_POST['oth']);
		LibFc::EchoJson($res);
	
	}


	/**
	  * @method 检查余额充值订单支付的支付信息
	  * @http  get
	  * @param  mocId	   int [必填] 订单ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function checkChongZhiOrderPay()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->checkChongZhiOrderPay($Params['mocId']);
		LibFc::EchoJson($res);
	}


	/**
	 * @method 获取商家入驻、PC版会员的对应的价格
	 * @http  get
	 * @param style      string [必填] shop:商家入驻 pcyear:pc年卡 pchyear:pc半年卡 pcmonth:pc月卡
	 * @param uid        string [选填] 购买人用户ID
	 * @param invcode    string [选填] 邀请码
	 * @param pct_pid    int [选填] 省ID  
	 * @param pct_cid    int [选填] 市
	 * @author soul 2019/12/14
	 * @return
		org_money:原价  paymoney:需要支付的金额   free_money:优惠多少钱
		接口返回的invcode 和 提交给接口的invcode 不一样表示邀请码无效
	 	{"status":true,"data":{"style":"shop","vip_id":"4","vip_name":"业务内容","org_money":"1800.00","paymoney":"600.00","free_money":"1200.00","btime":"2020-06-17 10:23:32","etime":"2021-06-17 10:23:32",invcode: "019690", "dco_id":"1","comany":"邀请码所属企业","sales":"邀请码所属业务员","pct_pid":"19","pct_cid":"1901"},"code":0}
	 */
	public function getVipStylePrice()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->getVipStylePrice($Params['style'], $Params['uid'], $Params['invcode'], $Params['pct_pid'], $Params['pct_cid']);
		LibFc::EchoJson($res);
	}


	/**
	 * @method 创建商家入驻、商家续费的订单
	 * @http   get
	 * @param uid        string [必填] 购买人用户ID
	 * @author soul 2019/12/14
	 * @return 
	 */
	public function buildShopVipOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildVipStyleOrder('shop', $Params['uid'], $Params['invcode'], $Params['pct_pid'], $Params['pct_cid']);
		LibFc::EchoJson($res);
	}


	/**
	 * @method 创建PCVIP会员的订单
	 * @http   get
	 * @param uid        string [必填] 购买人用户ID
	 * @param style      string [必填] shop:商家入驻 pcyear:pc年卡 pchyear:pc半年卡 pcmonth:pc月卡
	 * @param invcode    string [选填] 邀请码
	 * @param pct_pid    int [选填] 省ID 
	 * @param pct_cid    int [选填] 市
	 * @author soul 2019/12/14
	 * @return 
	 */
	public function buildPcVipOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildVipStyleOrder($Params['style'], $Params['uid'], $Params['invcode'], $Params['pct_pid'], $Params['pct_cid']);
		LibFc::EchoJson($res);
	}

		
	/**
	 * @method 同步附近配件商|维修厂的附近的地址和发现的地址
	 * @http   get
	 * @param shop_id    int [选填] 配件商ID || 维修厂ID
	 * @author soul 2019/12/14
	 * @return 
	 */
	public function updateShopAddr()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlShop = new PjlShop();
		$res = $PjlShop->updateShopAddr($Params['shop_id']);
		LibFc::EchoJson($res);
	}
	


	/**
	  * @method 招商显示记录收集
	  * @http   POST
	  * @param zsl_id string   [必填]   招商ID，多个逗号分隔
	  * @param uid    int   [选填]  用户ID
	  * @param Ip     string   [选填]  IP地址   IP|pct_ids
	  * @param pct_ids string   [选填]  省市ID  19,6544
	  * @author soul
	  * @copyright 2020/7/20
	  * @return 
		{"status":true,"data": true,"code":0}
	  */
	public function zhaoShangShow()
	{
		$temp = [
			'DTYPE'=>'ZS_SHOW',	
			'param'=>$_POST,
			'zs_atime'=>time()
		];
		$allTjArr = [json_encode($temp)];
		$MainRabbit = new MainRabbit('TJ_OTH');
		$MainRabbit->send($allTjArr);
		LibFc::ReturnJson(true, true);
	}

	
	/**
	 * @method 临时 处理跑街令logo
	 * @http   get
	 * @param shop_id    int [必填] 配件商ID
	 * @author soul 2020/8/26
	 * @return 
	 */
	public function initShopLogo()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlShop = new PjlShop();
		$res = $PjlShop->get('pl_shop', ['shop_id', 'shop_logo', 'shop_img'], sprintf(" and shop_id=%d", $Params['shop_id']), true);
		if(!empty($res['data']))
		{
			$baseUrl = 'http://file.yiparts.com/fpjl/shop/';
			$shopArr = $res['data'];
			if(stripos($shopArr['shop_logo'], 'small') === false && ( !empty($shopArr['shop_logo']) || !empty($shopArr['shop_img']) ) )
			{
				if(empty($shopArr['shop_logo'])) $shopArr['shop_logo'] = $shopArr['shop_img'];
				$shopArr['shop_logo'] = explode(',', $shopArr['shop_logo']);
				$sArr = ['/240/'=>'/'];
				$url = strtr($baseUrl.$shopArr['shop_logo'][0], $sArr);
				$LibHttp = new LibHttp();
				$html = $LibHttp->fetch($url);

				$OthFileCenter = new OthFileCenter();
				$dataArr = [
					'file'=>[
						'name'=>'t.jpg',
						'data'=>$html
					],
					'cate'=>'logos'
				];
				$res = $OthFileCenter->upload($dataArr, 'pjl');
				$set = ['shop_logo'=>$res['data']['sfile']];
				$PjlShop->set('pl_shop', $set, sprintf(" and shop_id=%d", $shopArr['shop_id']));
			}
		}
		LibFc::ReturnJson(true, true);
	}

	/**
	 * @method 临时 处理维修厂logo
	 * @http   get
	 * @param shop_id    int [必填] 配件商ID
	 * @author soul 2020/8/26
	 * @return 
	 */
	public function initRepairLogo()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlShop = new PjlShop();
		$res = $PjlShop->get('pl_repair', ['shopr_id', 'shopr_logo', 'shopr_img'], sprintf(" and shopr_id=%d", $Params['shopr_id']), true);
		if(!empty($res['data']))
		{
			$baseUrl = 'http://file.yiparts.com/fpjl/rate18/';
			$shopArr = $res['data'];
			if(stripos($shopArr['shopr_logo'], 'small') === false && ( !empty($shopArr['shopr_logo']) || !empty($shopArr['shopr_img']) ) )
			{
				if(empty($shopArr['shopr_logo'])) $shopArr['shopr_logo'] = $shopArr['shopr_img'];
				$shopArr['shopr_logo'] = explode(',', $shopArr['shopr_logo']);
				$sArr = ['/240/'=>'/'];
				$url = strtr($baseUrl.$shopArr['shopr_logo'][0], $sArr);
				$LibHttp = new LibHttp();
				$html = $LibHttp->fetch($url);

				$OthFileCenter = new OthFileCenter();
				$dataArr = [
					'file'=>[
						'name'=>'t.jpg',
						'data'=>$html
					],
					'cate'=>'logos'
				];
				$res = $OthFileCenter->upload($dataArr, 'pjl');
				$set = ['shopr_logo'=>$res['data']['sfile']];
				$PjlShop->set('pl_repair', $set, sprintf(" and shopr_id=%d", $shopArr['shopr_id']));
			}
		}
		LibFc::ReturnJson(true, true);
	}


	/**
	  * @method 将邀请赚钱余额全部提现到微信
	  * @http	post
	  * @param  u_id  string [必填] 用户ID
	  * @param  uac_id  string [必填] 收款账户id 只能提现到微信 
	  * @param  password  string [必填] 支付密码
	  * @author soul
	  * @copyright 2020/9/10
	  * @return 
	  */
	public function withdrawalsShareMoney()
	{
		$PjlMoney = new PjlMoney();
		$res = $PjlMoney->withdrawalsShareMoney($_POST['u_id'], $_POST['uac_id'], $_POST['password']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 关闭邀请提现申请
	  * @http	post
	  * @param  mow_id  string [必填] 分享赚钱 提现ID
	  * @param  mow_check_uid  string [必填] 审核人id
	  * @param  mow_check_uname  string [必填] 审核人姓名
	  * @param  mow_check_remark  string [必填] 审核备注
	  * @author soul
	  * @copyright 2021/6/28
	  * @return 
	  */
	public function closeWithdrawalsShareMoney()
	{
		$PjlMoney = new PjlMoney();
		$othData = [
			'mow_check_uid'=>$_POST['mow_check_uid'],	
			'mow_check_uname'=>$_POST['mow_check_uname'],	
			'mow_check_remark'=>$_POST['mow_check_remark'],	
		];
		$res = $PjlMoney->closeWithdrawalsShareMoney($_POST['mow_id'], $othData);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 店铺余额提现到微信转账检测
	  * @http	get
	  * @param  mow_id  string [必填] 提现记录ID
	  * @author soul
	  * @copyright 2021/4/16
	  * @return 
	  */
	public function checkWithdrawShop()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlMoney = new PjlMoney();
		$res = $PjlMoney->checkWithdrawShop($Params['mow_id']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 推送服务资源包单价
	  * @http  get
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function tsfwPacPrice()
	{
		LibFc::ReturnJson(true, mvc::$cfg['PJL_TS_PRICE']);
	}


	/**
	  * @method 创建推送服务资源包订单
	  * @http  get
	  * @param  uid	   int [必填] 会员ID	  
	  * @param  style  int [必填] 类型  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function buildTsfwPacOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->buildTsfwPacOrder($Params['uid'], $Params['style']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 获取推送服务资源包订单支付的支付信息
	  * @http  post
	  * @param  tuoId	   int [必填] 订单ID	  
	  * @param  payBy     string [必填]weixin|alipay
	  * @param  payType   string [必填]pc:扫码 app:APP wap:手机网 gzh:公众号
	  * @param  oth  array [可选] ['from'=>, 'wxopenid'=>]
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function payTsfwPacOrder()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->payTsfwPacOrder($_POST['tuoId'], $_POST['payBy'], $_POST['payType'], $_POST['oth']);
		LibFc::EchoJson($res);
	
	}


	/**
	  * @method 检查推送服务资源包订单支付的支付信息
	  * @http  get
	  * @param  tuoId	   int [必填] 订单ID	  
	  * @author soul
	  * @copyright 2018/9/20
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function checkTsfwPacOrderPay()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlUser = new PjlUser();
		$res = $PjlUser->checkTsfwPacOrderPay($Params['tuoId']);
		LibFc::EchoJson($res);
	}
	

	/**
	  * @method 推送服务资源包变动
	  * @http  post
	  * @param  tuc_shop_id	   int [必填] 店铺ID  
	  * @param  tuc_uid	   int [必填] 店主ID  
	  * @param  tuc_style	   string [必填] 类型 vin	  
	  * @param  tuc_change	   int [必填] 变动次数 如：100	  
	  * @param  tuc_des	   string [必填] 变动说明 如：系统赠送  
	  * @param  tuc_by	   string [选填] 操作人
	  * @param  tuc_remark	   string [选填] 备注信息
	  * @author soul
	  * @copyright 2021/4/7
	  * @return 
	  {"status":false,"data":,"code":''}
	  {"status":false,"data":'失败原因',"code":''}
	  */
	public function changeTsfwPac()
	{
		$PjlUser = new PjlUser();
		$res = $PjlUser->changeTsfwPac($_POST);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 将宜配网的求购同步到跑街令询价单
	  * @http  get
	  * @param  b_id	   int [必填] 宜配求购ID
	  * @author soul
	  * @copyright 2024/3/12
	  * @return 
	  */
	public function synYpBuyToPjl()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlPurchase = new PjlPurchase();
		$res = $PjlPurchase->synYpBuyToPjl($Params['b_id']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 开通群聊机器人或者同步微信群聊机器人的状态
	  * @http  get
	  * @param  shop_id	   int [必填] 宜配求购ID
	  * @author soul
	  * @copyright 2024/3/12
	  * @return 
	  */
	public function autoSetWxrobot()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlShop = new PjlShop();
		$res = $PjlShop->autoSetWxrobot($Params['shop_id']);
		LibFc::EchoJson($res);
	}

	/**
	  * @method 添加推送商家机器人消息
	  * @param  $shopId 店铺ID
	  * @return ["status"=> bool(true), "data"=> $tmh_id, "code"=>""]
	  */
	public function noticeShopRobot()
	{
		$Params = mvc::$URL_PARAMS;
		$PjlShop = new PjlShop();
		$res = $PjlShop->noticeShopRobot($Params['shop_id']);
		LibFc::EchoJson($res);
	}

	/**
	 * @method 初始化维修厂
	 * @param  $shoprId 维修厂ID(用户ID)
	 * @author zhengweihua 
	 * @copyright 2024-09-25
	 */
	public function initPjlRepair()
	{
		$Params = mvc::$URL_PARAMS;
		$shoprId = (int)$Params['shoprId'];
		$PjlShop = new PjlShop();
		$res = $PjlShop->initPjlRepair($shoprId);
		LibFc::EchoJson($res);
	}

	/**
	 * @method 入驻商家归属
	 * @http  get
	  * @param  shop_id	   int [必填] 宜配求购ID
	  * @author soul
	  * @copyright 2024/3/12
	  * @return 
	  */
	public function initShopVipYewu()
	{
		$Params = mvc::$URL_PARAMS;
		$CrmMain = new CrmMain();
		$res = $CrmMain->initShopVipYewu($Params['shop_id']);
		LibFc::EchoJson($res);
	}


	/**
	  * @method 跑街令VIP退款
	  * @http	post
	  * @param  u_id  string [必填] 用户ID
	  * @param  uvl_id  string [必填] VIP订单ID
	  * @param  refund_password  string [必填] 退款密码
	  * @param  refund_money  float [必填] 退款金额
	  * @param  selftc_money  float [选填] 代理提成金额
	  * @param  ywytc_money  float [选填] 业务提成金额
	  * @param  remark  string [必填] 退款原因
	  * @param  by_uid  string [必填] 操作人
	  * @author soul
	  * @copyright 2025/11/11
	  * @return 
	  */
	public function refundPjViplOrder()
	{
		$PjlUser = new PjlUser();
		$res = $PjlUser->refundPjViplOrder($_POST);
		LibFc::EchoJson($res);
	}
}