作者 chencheng

0531-2

... ... @@ -150,6 +150,7 @@ class Client extends Api
->where($where)
->paginate($total, false, ['page' => $page])
->toArray();
return $this->success($row);
}
/**
... ...
... ... @@ -370,9 +370,14 @@ class Wechat extends Api
* $order_info 支付成功后的订单信息
*/
public function sales_distribution($order_info){
public function sales_distribution($order_info=[]){
//测试
$order_info = Db::name('verification_order')->where("id='14'")->find();
if(empty($order_info)){ return $this->error('订单信息不存在');}
$w['id'] = $order_info['user_id'];
$myInfo = Db::name('user')->where($w)->find();
//是否与上级
if(!empty($myInfo['pid'])){
//上级
... ... @@ -381,11 +386,14 @@ class Wechat extends Api
}catch(\Exception $e){
Common::put_file_log('上级-分销异常',json_encode($e->getMessage()), 'sales_distribution', __CLASS__ . __FUNCTION__ . __LINE__);
}
die;
//上级的上级
try{
$w1['id'] = $myInfo['pid'];
$myInfoP = Db::name('user')->where($w1)->find();
$this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']);
if(!empty($myInfoP['pid'])){
$this->getParent($myInfoP['id'],$order_info['verification_store_id'],$order_info['id']);
}
}catch(\Exception $e){
Common::put_file_log('上级的上级-分销异常',json_encode($e->getMessage()), 'sales_distribution', __CLASS__ . __FUNCTION__ . __LINE__);
}
... ...