public function checkSales($attribute, $params)
 {
     foreach ($this->{$attribute} as $salesId) {
         $query = new \yii\db\Query();
         $query->select('id')->from(ResUsers::tableName())->where('id = :salesIds')->addParams([':salesIds' => $salesId]);
         if (!$query->exists()) {
             $this->addError($attribute, 'Sales Man did you search is not exist for sales man id ' . $salesId);
         }
     }
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCreateU()
 {
     return $this->hasOne(ResUsers::className(), ['id' => 'create_uid']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSalesMan()
 {
     return $this->hasOne(ResUsers::className(), ['id' => 'sales_man_id']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getChecker0()
 {
     return $this->hasOne(ResUsers::className(), ['id' => 'checker']);
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getResUsers()
 {
     return $this->hasMany(ResUsers::className(), ['partner_id' => 'id']);
 }
Example #6
0
 public function getUser()
 {
     return $this->hasOne(ResUsers::className(), ['id' => 'user_id']);
 }
Example #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getApprover30()
 {
     return $this->hasOne(ResUsers::className(), ['id' => 'approver3']);
 }