标签:数组 user 返回 save art time tar order start
一 、查询
返回数组
$cond[] = "and";//条件数组需要加and,单一个字符串不需要加。 $cond[] = "payTime >= ‘{$startDate}‘"; $cond[] = "payTime <‘{$endDate}‘"; $field = [‘merId‘,‘mchntName‘,‘orderId‘]; $payLog = WebPayRecord::find()->select($field)->where($cond)->asArray()->all();
返回对象
$payLog = WebPayRecord::find()->where("merTrxId = ‘{$merTrxId}‘")->one();
二、保存、更新
$this->card_record = new BankCardRecord(); $this->card_record[‘userName‘]= "dawei"; $this->card_record->save(); $bankCard = BankCardRecord::find()->where($cond)->one(); if(!empty($bankCard)){ $bankCard[‘updateTime‘] = date(‘Y-m-d H:i:s‘); $bankCard->update(); }
标签:数组 user 返回 save art time tar order start
原文地址:http://www.cnblogs.com/shijianchuzhenzhi/p/7799119.html