This commit is contained in:
weiz 2024-04-12 15:12:33 +08:00
parent e07b515620
commit 7576f74ff6
3 changed files with 33 additions and 25 deletions

View File

@ -54,11 +54,12 @@
*/
public function lists(): array
{
return MarketingBidResultDetail::where($this->searchWhere)
->field(['id', 'bid_result_id', 'company', 'quotation_one', 'quotation_two', 'quotation_three', 'final_rate', 'manager', 'month', 'result'])
return MarketingBidResultDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->select()->each(function ($data) {
$data['result_text'] = $data->result_text;
})
->toArray();
}

View File

@ -115,6 +115,8 @@
*/
public static function detail($params): array
{
return MarketingBidResultDetail::findOrEmpty($params['id'])->toArray();
$data = MarketingBidResultDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']);
$data['result_text'] = $data->result_text;
return $data->toArray();
}
}

View File

@ -11,24 +11,29 @@
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\marketing;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 市场经营--投标管理--投标结果--参标单位模型
* Class MarketingBidResultDetail
* @package app\common\model\marketing
*/
class MarketingBidResultDetail extends BaseModel
{
use SoftDelete;
protected $name = 'marketing_bid_result_detail';
protected $deleteTime = 'delete_time';
}
namespace app\common\model\marketing;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 市场经营--投标管理--投标结果--参标单位模型
* Class MarketingBidResultDetail
* @package app\common\model\marketing
*/
class MarketingBidResultDetail extends BaseModel
{
use SoftDelete;
protected $name = 'marketing_bid_result_detail';
protected $deleteTime = 'delete_time';
public function getResultTextAttr($value, $data): string
{
$arr = [0 => '中标', 1 => '未中标'];
return $arr[$data['result']];
}
}