|
|
|
@ -207,6 +207,9 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
$share = floor(($shareStatistics->current - $shareStatistics->last_point) / $config['share_get_welfare_limit']); |
|
|
|
|
$shareStatistics->last_point = $shareStatistics->last_point + $config['share_get_welfare_limit'] * $share; |
|
|
|
|
$shareStatistics->save(); |
|
|
|
|
if($share > $assets['share_point']){ |
|
|
|
|
$share = $assets['share_point']; |
|
|
|
|
} |
|
|
|
|
$logList[] = array( |
|
|
|
|
'uid' => $item['uid'], |
|
|
|
|
'asset_type' => UserAssetsLogRepository::ASSET_TYPE_SHARE_POINT, |
|
|
|
@ -237,7 +240,8 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function consumeToShare($uid, $count){ |
|
|
|
|
public function consumeToShare($uid, $count) |
|
|
|
|
{ |
|
|
|
|
$config = $this->getConfig(); |
|
|
|
|
$assets = $this->assets($uid); |
|
|
|
|
if ($assets['consume'] < $config['consume_to_share'] * $count) { |
|
|
|
@ -277,7 +281,8 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function sendHuitong($uid, $phone, $count){ |
|
|
|
|
public function sendHuitong($uid, $phone, $count) |
|
|
|
|
{ |
|
|
|
|
$assets = $this->assets($uid); |
|
|
|
|
if ($assets['huitong'] < $count) { |
|
|
|
|
throw new \Exception('惠通宝不足'); |
|
|
|
@ -322,7 +327,6 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* notes |
|
|
|
|
* @param $uid |
|
|
|
@ -335,7 +339,8 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function huitongToConsume($uid, $count){ |
|
|
|
|
public function huitongToConsume($uid, $count) |
|
|
|
|
{ |
|
|
|
|
$current = app(HuitongRepository::class)->getCurrent(); |
|
|
|
|
$assets = $this->assets($uid); |
|
|
|
|
if ($assets['huitong'] < $count) { |
|
|
|
@ -372,7 +377,8 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function sign($uid, $consume){ |
|
|
|
|
public function sign($uid, $consume) |
|
|
|
|
{ |
|
|
|
|
$logList = array(); |
|
|
|
|
$logList[] = array( |
|
|
|
|
'uid' => $uid, |
|
|
|
@ -387,11 +393,13 @@ class UserAssetsRepository extends BaseRepository |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getSum($field){ |
|
|
|
|
public function getSum($field) |
|
|
|
|
{ |
|
|
|
|
return $this->dao->getSum($field); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getWhereCount($where){ |
|
|
|
|
public function getWhereCount($where) |
|
|
|
|
{ |
|
|
|
|
return $this->dao->getWhereCount($where); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|