|
@@ -16,130 +16,7 @@ class Plantask extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- public function auto_user_level_up_old(){
|
|
|
- Db::startTrans();
|
|
|
- $tasklist = Db::name('gift_user_party')->where('task_status',0)->limit(20)->lock(true)->select();
|
|
|
- if(empty($tasklist)){
|
|
|
- Db::rollback();
|
|
|
- echo 'empty';
|
|
|
- exit;
|
|
|
- }
|
|
|
|
|
|
- try {
|
|
|
-
|
|
|
- $redis = new Redis();
|
|
|
- $redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
- if ($redisconfig['redis_pwd']) {
|
|
|
- $redis->auth($redisconfig['redis_pwd']);
|
|
|
- }
|
|
|
- if($redisconfig['redis_selectdb'] > 0){
|
|
|
- $redis->select($redisconfig['redis_selectdb']);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- foreach($tasklist as $key => $giftuserparty){
|
|
|
-
|
|
|
-
|
|
|
- $giftValue = $giftuserparty['value'];
|
|
|
- $hotValue = $giftValue;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $getMoney = bcdiv($giftuserparty['getvalue'],$money_to_jewel,2);
|
|
|
- if($getMoney > 0){
|
|
|
- $rs_wallet = model('wallet')->lockChangeAccountRemain($user_id,$getMoney,'+',0,"{$authuser_info['nickname']}送你{$giftuserparty['gift_name']}x{$giftuserparty['number']}",101,'money');
|
|
|
- if($rs_wallet['status'] == false){
|
|
|
- Db::rollback();
|
|
|
- $this->error($rs_wallet['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
- $partyInfo = \app\common\model\Party::field("id,room_type,party_name,party_hot,user_id,platRate,guilderRate,easemob_room_id")->where(["id"=>$giftuserparty['party_id']])->find();
|
|
|
-
|
|
|
-
|
|
|
- $guilderMoney = bcdiv($giftuserparty['guildervalue'],$money_to_jewel,2);
|
|
|
- if($guilderMoney > 0){
|
|
|
- $rs_wallet = model('wallet')->lockChangeAccountRemain($partyInfo->user_id,$guilderMoney,'+',0,"{$authuser_info['nickname']}送礼物{$giftuserparty['gift_name']}x{$giftuserparty['number']}给{$touserInfo['nickname']},房间礼物抽成",102,'money');
|
|
|
- if($rs_wallet['status'] == false){
|
|
|
- Db::rollback();
|
|
|
- $this->error($rs_wallet['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
- $this->updateSeatCharm($partyInfo['easemob_room_id'],$giftuserparty['seat_num'],$hotValue,$partyInfo,$redis);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $data = [];
|
|
|
- $data["user_id"] = $giftuserparty['user_to_id'];
|
|
|
- $data["party_id"] = $party_id;
|
|
|
- $data["charm"] = $hotValue;
|
|
|
- $data["createtime"] = time();
|
|
|
- \app\common\model\UserCharmRank::insert($data);
|
|
|
-
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if(isset($noble["noble_on"]) && $noble["noble_on"] == 1) {
|
|
|
- $getempirical = $getempirical + $getempirical * ($noble["explain"]/100);
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $this->auth->level = $res->level;
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $rs_up = Db::name('gift_user_party')->where('id',$giftuserparty['id'])->update(['task_status'=>1]);
|
|
|
- if($rs_up === false){
|
|
|
- Db::rollback();
|
|
|
- echo '更新错误'.$giftuserparty['id'];
|
|
|
- exit;
|
|
|
- }
|
|
|
- }
|
|
|
- Db::commit();
|
|
|
- } catch (ValidateException $e) {
|
|
|
- Db::rollback();
|
|
|
- $this->error($e->getMessage());
|
|
|
- } catch (PDOException $e) {
|
|
|
- Db::rollback();
|
|
|
- $this->error($e->getMessage());
|
|
|
- } catch (Exception $e) {
|
|
|
- Db::rollback();
|
|
|
- $this->error($e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
|
|
|
public function auto_user_level_up(){
|