12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/11/2
- * Time: 上午9:44
- */
- //todo 送首单礼品,活动推荐,红包,F码过期提醒,邀请,购物奖励
- namespace async_push;
- use member_info;
- use fcode;
- use push_helper;
- class status extends IPusher
- {
- 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_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 true;
- }
- private function check_fcode()
- {
- return true;
- }
- }
|