__('Status 0'), '1' => __('Status 1'), '-1' => __('Status -1')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public static function sos_create($where) { self::beginTrans(); try { if(SosBill::where('id', $where['user_id'])->where('rescuers_id',$where['rescuers_id'])->whereTime('createtime',"today")->find()) return self::setErrorInfo('已求救,不用重复发起!'); $res = self::create($where); $user_phone = User::where('id', $where['user_id'])->value('mobile'); $rescue_phone = User::where('id', $where['rescuers_user_id'])->value('mobile'); $rescuers_id = Rescue::where('uid',$where['rescuers_user_id'])->value('id'); $res1 = SosBill::income($where['cid'], $where['user_id'], $res['id'], $rescuers_id,$where['rescuers_user_id'], $where['latitude'], $where['longitude'], $user_phone, $rescue_phone,$where['address']); //tudo 模板信息 if($res && $res1) { self::commitTrans(); } }catch (Exception $e) { return self::setErrorInfo($e->getMessage(),true); } return $res; } }