Issues (63)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/models/Order.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace graychen\yii2\jd\deposit\models;
4
5
use yii\behaviors\TimestampBehavior;
6
7
/**
8
 * This is the model class for table "{{%order}}".
9
 * @SuppressWarnings(PHPMD.CamelCasePropertyName)
10
 * @property OrderPaymentRecord $orderPaymentRecord
11
 */
12
class Order extends \yii\db\ActiveRecord
13
{
14
    public $source = 'PC';
15
    const TYPE_JD= 'JD充值';
16
    const SOURCE_JD= 'JD';//京东
17
    const PAYMENT_METHOD_JD = 9; //京东支付
18
19
    const STATUS_SUCCESS=0;
20
    const STATUS_RECHARGE=1;
21
    const STATUS_FAILURE=2;
22
23
    const TYPE_PEIWAN_PUTONG = 1; //普通陪玩
24
    const TYPE_PEIWAN_YANZHI = 2; //颜值陪玩
25
    const TYPE_SHANGFEN_PEILIAN = 3; //陪练上分
26
    const TYPE_SHANGFEN_DAIDA = 4; //代打上分
27
28
    const STATUS_REFUNDING = -5; //退款中
29
    const STATUS_REFUND_FAILED = -4; //退款失败
30
    const STATUS_REFUNDED = -3; //已退款
31
    const STATUS_PAY_FAILED = -2; //支付失败
32
    const STATUS_UNPAID = -1; //未支付
33
    const STATUS_PAID = 0; //未派单, 已支付
34
    const STATUS_IN_DISPATCH = 1; //正在派单
35
    const STATUS_IN_SERVICE = 2; //服务中
36
    const STATUS_APPLY_COMPLETED = 3; //申请完成
37
    const STATUS_FINISHED = 4; //已完成
38
    const STATUS_CLOSED = 5; //已关闭
39
40
41
    /**
42
     * @inheritdoc
43
     */
44 1
    public static function tableName()
45
    {
46 1
        return '{{%order}}';
47
    }
48
49
    /**
50
     * @inheritdoc
51
     */
52 1
    public function rules()
53
    {
54
        return [
55 1
           [['id', 'game_id', 'type','user_id','hours', 'status', 'created_at', 'updated_at', 'payment_method'], 'integer'],
56
           [['sn',  'serverinfo', 'account', 'password', 'remark', 'client_id', 'name', 'description'], 'safe'],
57
           [['count', 'final_price'], 'number'],
58
        ];
59
    }
60
61
    /**
62
     * @inheritdoc
63
     */
64 1
    public function behaviors()
65
    {
66
        return [
67
            'timestamp' => [
68 1
                'class' => TimestampBehavior::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
69
            ],
70
        ];
71
    }
72
73
    /**
74
     * @inheritdoc
75
     */
76
    public function attributeLabels()
77
    {
78
        return [
79
            'id' => 'ID',
80
            'sn' => '订单号',
81
            'game_id' => '游戏ID',
82
            'type' => '订单分类',
83
            'user_id' => '用户ID',
84
            'count' =>'陪玩局数/时长',
85
            'final_price' => '价格',
86
            'equipment' => '区服信息',
87
            'serverinfo' => '详细区服信息',
88
            'account' => '用户帐号/游戏昵称',
89
            'password' => '用户帐号和密码',
90
            'remark' => '备注',
91
            'status' => '订单状态',
92
            'created_at' => '创建时间',
93
            'updated_at' => '更新时间',
94
            'payment_method' => '支付方式',
95
            'source' => '订单来源',
96
        ];
97
    }
98
99
    /**
100
     * 订单状态列表
101
     * @return array
102
     */
103
    public static function getStatusList()
104
    {
105
        return [
106
            self::STATUS_SUCCESS => '充值成功',
107
            self::STATUS_RECHARGE => '充值中',
108
            self::STATUS_FAILURE => '充值失败',
109
        ];
110
    }
111
112
    /**
113
     * 京东Skuid对照表
114
     */
115 1
    public static function skuidList()
116
    {
117
        return [
118
            '21064017372' => [
119 1
                'game_id' => 2,
120 1
                'type' => self::TYPE_PEIWAN_YANZHI,
121 1
                'name' => '吃鸡陪玩绝地求生大逃杀全军出击刺激战场荒野行动光荣使命双排吃鸡实力带躺',
122
            ],
123
            '19025625428' => [
124 1
                'game_id' => 1,
125 1
                'type' => self::TYPE_SHANGFEN_PEILIAN,
126 1
                'name' => '王者荣耀陪练排位大神陪玩包带上分上星代练代打双排匹配熟练度升级成就赏金冒险连胜'
127
            ],
128
            '19027152924' => [
129 1
                'game_id' => 1,
130 1
                'type' => self::TYPE_SHANGFEN_PEILIAN,
131 1
                'name' => '王者荣耀大神陪练美女陪玩双排排位匹配熟练度升级成就赏金冒险连胜'
132
            ],
133
            '19087622210' => [
134 1
                'game_id' => 1,
135 1
                'type' => self::TYPE_SHANGFEN_PEILIAN,
136 1
                'name' => '王者荣耀代练上星代打上分上段美女陪玩大神陪练排位匹配熟练度成就升级赏金冒险连胜'
137
            ],
138
            '19148161614' => [
139 1
                'game_id' => 1,
140 1
                'type' => self::TYPE_SHANGFEN_PEILIAN,
141 1
                'name' => '补差价单 王者荣耀代打代练大神陪练美女陪玩双排匹配成就熟练度升级赏金冒险'
142
            ],
143
            '25219449932' => [
144 1
                'game_id' => 1,
145 1
                'type' => self::TYPE_PEIWAN_YANZHI,
146 1
                'name' => 'QQ飞车手游qq飞车代抽永久A车黑夜传说大神代练美女陪玩代刷成就剧情等级经验金币'
147
            ]
148
        ];
149
    }
150
}
151