public function getClients($id)
 {
     $vendedor = Vendedor::find($id);
     $client = Client::select('name', 'telephone')->with('vendedor')->where('vendedor_id', '=', $id)->get();
     //dd($clients->toArray());
     return view("vendedores.clients")->with(array('vendedor' => $vendedor, 'client' => $client));
     return redirect()->back();
 }
示例#2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Vendedor::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['telefonoVendedor' => $this->telefonoVendedor]);
     $query->andFilterWhere(['like', 'rutVendedor', $this->rutVendedor])->andFilterWhere(['like', 'nombreVendedor', $this->nombreVendedor]);
     return $dataProvider;
 }
示例#3
0
文件: Venda.php 项目: alissoncti/sgo
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getVendedorIdvendedor()
 {
     return $this->hasOne(Vendedor::className(), ['idvendedor' => 'vendedor_idvendedor']);
 }
示例#4
0
文件: Loja.php 项目: alissoncti/sgo
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getVendedors()
 {
     return $this->hasMany(Vendedor::className(), ['loja_id' => 'idloja']);
 }
示例#5
0
 public function actionListarRemoto($search = null, $id = null)
 {
     $out = ['more' => false];
     if (!is_null($search)) {
         $query = new Query();
         $query->select('idvendedor AS id, nome AS text')->from('vendedor')->where('nome LIKE "%' . $search . '%"')->limit(200);
         $command = $query->createCommand();
         $data = $command->queryAll();
         $out['results'] = array_values($data);
     } elseif ($id > 0) {
         $out['results'] = ['id' => $id, 'text' => Vendedor::findOne($id)->nome];
     } else {
         $out['results'] = ['id' => 0, 'text' => 'No matching records found'];
     }
     echo Json::encode($out);
 }