|
|
|
@ -153,6 +153,39 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
$this->recommendAssets($orderItem['mer_id'], $orderItem['order_id'], $config, $base); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 6. 商户和平台资产 |
|
|
|
|
// $this->merchantAndPlatformAssets($orderItem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function merchantAndPlatformAssets($orderItem){ |
|
|
|
|
/** |
|
|
|
|
* @var MerchantRepository $merchantRepository |
|
|
|
|
*/ |
|
|
|
|
$merchantRepository = app(MerchantRepository::class); |
|
|
|
|
$merchant = $merchantRepository->get($orderItem['mer_id']); |
|
|
|
|
if(empty($merchant)){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* @var UserRepository $userRepository |
|
|
|
|
*/ |
|
|
|
|
$userRepository = app(UserRepository::class); |
|
|
|
|
$user = $userRepository->searchOne(['phone' => $merchant['mer_phone']]); |
|
|
|
|
$logList = array(); |
|
|
|
|
$welfare = $huitong = $contribution = 0; |
|
|
|
|
if($user){ |
|
|
|
|
$logList[] = array( |
|
|
|
|
'uid' => $user['uid'], |
|
|
|
|
'asset_type' => self::ASSET_TYPE_WELFARE, |
|
|
|
|
'type' => self::CHANGE_TYPE_ORDER_GET, |
|
|
|
|
'status' => self::STATUS_FROZEN, |
|
|
|
|
'order_id' => $orderItem['order_id'], |
|
|
|
|
'count' => $welfare, |
|
|
|
|
'mer_id' => $merchant['id'], |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -516,6 +549,35 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* notes 获取资产变动日志 |
|
|
|
|
* @param $uid |
|
|
|
|
* @param $where |
|
|
|
|
* @param $page |
|
|
|
|
* @param $limit |
|
|
|
|
* @return array |
|
|
|
|
* @throws DataNotFoundException |
|
|
|
|
* @throws DbException |
|
|
|
|
* @throws ModelNotFoundException |
|
|
|
|
* @create 2024/3/18 17:37 |
|
|
|
|
* @update 2024/3/18 17:37 |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function list($uid, $where, $page, $limit){ |
|
|
|
|
$query = $this->dao->search($uid, $where); |
|
|
|
|
$count = $query->count(); |
|
|
|
|
$data = $query->page($page, $limit)->select(); |
|
|
|
|
$list = array(); |
|
|
|
|
$changeType = $this->getChangeType(); |
|
|
|
|
foreach ($data as $item){ |
|
|
|
|
$item['type'] = $changeType[$item['type']]; |
|
|
|
|
$list[] = $item; |
|
|
|
|
} |
|
|
|
|
return compact('count', 'list'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function userRefund() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|