1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/11/2
- * Time: 上午9:44
- */
- //todo 送首单礼品,活动推荐,红包,F码过期提醒,邀请,购物奖励
- namespace async;
- use member_info;
- use fcode;
- use push_helper;
- class status extends IAsync
- {
- private $member_id;
- private $mod_member;
- private $mem_info;
- public function __construct($member_id)
- {
- $this->member_id = $member_id;
- $this->mod_member = Model('member');
- $mem_info = $this->mod_member->getMemberInfoByID($member_id);
- $this->mem_info = new member_info($mem_info);
- }
- public function run()
- {
- if($this->check_present()) return;
- if($this->check_bonus()) return;
- if($this->check_fcode()) return;
- }
- private function check_version()
- {
- $ver_code = $_SESSION['client_version'];
- if($_SESSION['client_type'] == 'ios')
- {
- $cur_ver = $GLOBALS['setting_config']['mobile_ios_version'];
- $cur_ver = intval($cur_ver * 100 + 0.5);
- $ver_code = intval($ver_code * 100 + 0.5);
- if($ver_code < $cur_ver) {
- $url = $GLOBALS['setting_config']['mobile_ios'];
- $tips = $GLOBALS['setting_config']['mobile_update_tips'];
- $artips = explode('#',$tips);
- $tips = implode("\n",$artips);
- }
- }
- elseif($_SESSION['client_type'] == 'android')
- {
- $cur_ver = $GLOBALS['setting_config']['mobile_apk_version'];
- $cur_ver = intval($cur_ver * 100 + 0.5);
- $ver_code = intval($ver_code * 100 + 0.5);
- if($ver_code < $cur_ver) {
- $url = $GLOBALS['setting_config']['mobile_apk'];
- $tips = $GLOBALS['setting_config']['mobile_update_tips'];
- $artips = explode('#',$tips);
- $tips = implode("\n",$artips);
- }
- }
- return false;
- }
- private function check_present()
- {
- if($this->mem_info->order_num() > 0) {
- return false;
- }
- if($this->mem_info->first_present() > 0) {
- return false;
- }
- $result = fcode\present_manager::instance()->fetch($this->mem_info->mobile(),null);
- if($result == false) return false;
- $fcode = $result['fcode'];
- $this->mod_member->editMember(['member_id' => $this->member_id],['first_present' => intval($fcode['fc_id'])]);
- push_helper::first_present($this->member_id,$fcode);
- return true;
- }
- private function check_bonus()
- {
- return false;
- }
- private function check_fcode()
- {
- return false;
- }
- }
|