예제 #1
0
파일: MOffice.php 프로젝트: noikiy/wowewe
 public static function getOfficeNameOptionSimple2($gh_id, $json = true, $need_prompt = true)
 {
     $offices = MOffice::find()->where("gh_id = :gh_id AND role = :role AND is_jingxiaoshang=:is_jingxiaoshang", [':gh_id' => $gh_id, ':role' => 1, ':is_jingxiaoshang' => 0])->asArray()->all();
     $listData = $need_prompt ? ['0' => '请选择营业厅'] : [];
     foreach ($offices as $office) {
         $value = $office['office_id'];
         $text = $office['title'];
         $listData[$value] = $text;
     }
     U::utf8_array_asort($listData);
     return $json ? json_encode($listData) : $listData;
 }