Hi, the model has the conditions or scope bug, please view http://octobercms.com/forum/post/modify-the-code-to-solved-using-conditions-scope-not-working-bug This is my fixed, but I think it is not good.
I think your plugin maybe can fix this bug, but it is used in controller, how to use in model? public $belongsTo = [ 'priority' => ['Leadrive\Pm\Models\ConfigStatus', 'conditions' => 'field_name = "wx_issue_priority"' //'scope' => 'isWxIssuePriority' ], ];
in the columns.yaml columns: priority_name: label: 'leadrive.pm::lang.wxissue.priority' relation: priority select: name sortable: true width: 100px
In the model, if the relation has conditions or scope, it will not work, such in the list, it will not working, because the 'priority' return more records. The table leadrive_pm_config_statuses maybe is: id field_name name 1 wx_issue_priority priority class 1 1 issue_priority priority class 1
Because the conditions did not work, so it will return 2 records(the correct answer is one record),