Example #1
0
 public function _indexconfig()
 {
     $network = Network::where(['NETWORK_TYPE' => 1])->get(['ID', 'NAME']);
     $result = [];
     foreach ($network as $n) {
         $tmp = [];
         $count = AllocJob::where(['NETWORK_ID' => $n->ID])->count();
         if ($count > 0) {
             $tmp['NAME'] = $n->NAME . '(' . $count . ')';
         } else {
             $tmp['NAME'] = $n->NAME;
         }
         $tmp['ID'] = $n->ID;
         array_push($result, $tmp);
     }
     $code_alloc_value_type = CodeAllocValueType::all('ID', 'NAME');
     $facility = Facility::all('ID', 'NAME');
     $code_alloc_type = CodeAllocType::all('ID', 'NAME');
     $codeFlowPhase = CodeFlowPhase::all('ID', 'NAME');
     $codeAllocValueType = CodeAllocValueType::all('ID', 'NAME');
     return view('front.allocset', ['result' => $result, 'CodeAllocValueType' => $code_alloc_value_type, 'facility' => $facility, 'codeAllocType' => $code_alloc_type, 'codeFlowPhase' => $codeFlowPhase, 'codeAllocValueType' => $codeAllocValueType]);
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNetwork()
 {
     return $this->hasOne(Network::className(), ['id' => 'network_id']);
 }
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNetworks()
 {
     return $this->hasMany(Network::className(), ['id' => 'network_id'])->viaTable('network_has_messages', ['messages_id' => 'id']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNetworks()
 {
     return $this->hasMany(Network::className(), ['accounts_id' => 'id']);
 }