|
|
|
@ -32,8 +32,9 @@ use app\common\repositories\user\UserAddressRepository; |
|
|
|
|
class OrderPartnerJob implements JobInterface |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
public function fire($job,$data) |
|
|
|
|
public function fire($job, $data) |
|
|
|
|
{ |
|
|
|
|
file_put_contents('/tmp/debug_partner', '开始处理贡献值订单:'.var_export($data, 1), 8); |
|
|
|
|
try { |
|
|
|
|
//初始化贡献值 |
|
|
|
|
$bao_price = $mian_price = $ping_price = $total_price = 0; |
|
|
|
@ -201,7 +202,7 @@ class OrderPartnerJob implements JobInterface |
|
|
|
|
->select()->toArray(); |
|
|
|
|
|
|
|
|
|
$role_ids = array_column($trade_roles, 'id'); |
|
|
|
|
$trade_trade_data = array_column($trade_roles,null, 'id'); |
|
|
|
|
$trade_trade_data = array_column($trade_roles, null, 'id'); |
|
|
|
|
$user_list = User::getDB()->alias('u') |
|
|
|
|
->leftJoin('UserPartner p', 'u.uid = p.uid') |
|
|
|
|
->whereIn('p.partner_id', $role_ids) |
|
|
|
@ -244,8 +245,8 @@ class OrderPartnerJob implements JobInterface |
|
|
|
|
->whereIn('area_id', $area_ids) |
|
|
|
|
->select()->toArray(); |
|
|
|
|
|
|
|
|
|
$role_ids = array_column($area_roles, 'id'); |
|
|
|
|
$trade_trade_data = array_column($area_roles, null,'id'); |
|
|
|
|
$role_ids = array_column($area_roles, 'id'); |
|
|
|
|
$trade_trade_data = array_column($area_roles, null, 'id'); |
|
|
|
|
$user_list = User::getDB()->alias('u') |
|
|
|
|
->leftJoin('UserPartner p', 'u.uid = p.uid') |
|
|
|
|
->whereIn('p.partner_id', $role_ids) |
|
|
|
@ -280,7 +281,7 @@ class OrderPartnerJob implements JobInterface |
|
|
|
|
->where('status', 1) |
|
|
|
|
->select()->toArray(); |
|
|
|
|
$role_ids = array_column($common_roles, 'id'); |
|
|
|
|
$common_trade_data = array_column($common_roles, null,'id'); |
|
|
|
|
$common_trade_data = array_column($common_roles, null, 'id'); |
|
|
|
|
$user_list = User::getDB()->alias('u') |
|
|
|
|
->leftJoin('UserPartner p', 'u.uid = p.uid') |
|
|
|
|
->field('u.*,p.partner_id') |
|
|
|
@ -288,7 +289,7 @@ class OrderPartnerJob implements JobInterface |
|
|
|
|
->where('u.uid', '<>', $data['uid']) |
|
|
|
|
->select(); |
|
|
|
|
|
|
|
|
|
if(!empty($user_list)){ |
|
|
|
|
if (!empty($user_list)) { |
|
|
|
|
$user_list = $user_list->toArray(); |
|
|
|
|
$user_count = count($user_list); |
|
|
|
|
foreach ($user_list as $cuk => $cuv) { |
|
|
|
|