Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

3 роки тому
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "main_corp_user".
  6. *
  7. * @property integer $id
  8. * @property string $user_name
  9. * @property integer $main_corp_id
  10. * @property string $main_corp_name
  11. */
  12. class MainCorpUser extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return 'main_corp_user';
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['main_corp_id'], 'integer'],
  28. [['user_name', 'main_corp_name'], 'string', 'max' => 255],
  29. ];
  30. }
  31. /**
  32. * @inheritdoc
  33. */
  34. public function attributeLabels()
  35. {
  36. return [
  37. 'id' => 'ID',
  38. 'user_name' => 'User Name',
  39. 'main_corp_id' => 'Main Corp ID',
  40. 'main_corp_name' => 'Main Corp Name',
  41. ];
  42. }
  43. /**
  44. * Des:根据主体获取运营负责人列表
  45. * Name: getListForUserMianCorp
  46. * @author 倪宗锋
  47. */
  48. public function getListForUserMainCorp()
  49. {
  50. $where = [];
  51. $cookies = $_COOKIE;
  52. if (empty($cookies['user_main_corp'])== false && $cookies['user_main_corp'] != 1) {
  53. $where = ['=', 'main_corp_id', $cookies['user_main_corp']];
  54. }
  55. $list = self::find()->where($where)->asArray()->all();
  56. return $list;
  57. }
  58. }